aboutsummaryrefslogtreecommitdiff
path: root/bin
Commit message (Collapse)AuthorAgeFilesLines
* Split updatepwd() into two smaller functions. The first one, findpwd(),Stefan Farfeleder2008-02-241-38/+45
| | | | | | | | | | | | | computes the new path and the second one, updatepwd(), updates the variables PWD, OLDPWD and the path used for the pwd builtin according to the new directory. For a logical directory change, chdir() is now called between those two functions, no longer causing wrong values to be stored in PWD etc. if it fails. PR: 64990, 101316, 120571 Notes: svn path=/head/; revision=176521
* Fix "warning: comparison is always false due to limited range of data type"Marcel Moolenaar2008-02-181-4/+1
| | | | | | | | | | on platforms with unsigned chars. The comparison in question is there to determine whether chars are unsigned or not and is based on comparing a char, initialized to -1, for less than 0. Change the comparison to check for geater than 0 instead... Notes: svn path=/head/; revision=176392
* Don't reset DST computed by strptime() (when e.g. setting theRuslan Ermilov2008-02-071-6/+3
| | | | | | | | | | date via -f %s). Reported by: Eugene Grosbein Diagnosed by: Miguel Lopes Santos Ramos Notes: svn path=/head/; revision=176094
* - Roll-back attempts to mimic rename(2) atomicity introduced in 1.47,Diomidis Spinellis2007-12-271-95/+69
| | | | | | | | | | | | | | | | | and follow the letter of the POSIX specification. - Moving a directory to an existing non-empty directory will now fail, as required. - Improve consistency and remove some style bugs of earlier versions. This version passes all tests of tools/regression/bin/mv/regress.sh 1.6 Reviewed by: bde MFC after: 1 month Notes: svn path=/head/; revision=174935
* As suggested, replace earlier changed warnx() / exit() with an errx()Edwin Groothuis2007-12-261-4/+3
| | | | | | | Submitted by: Peter Jeremy <peterjeremy@optushome.com.au> Notes: svn path=/head/; revision=174912
* When copying multiple files to a directory, make sure that a properEdwin Groothuis2007-12-251-1/+1
| | | | | | | | | | | | warning is given when the directory doesn't exist. PR: bin/50656 Submitted by: Edwin Groothuis <edwin@mavetju.org> Approved by: grog@ Not reviewed by: grog@ Notes: svn path=/head/; revision=174890
* Calling any function from vfork other than exec* and _exit yieldsDiomidis Spinellis2007-12-171-3/+9
| | | | | | | | | undefined behavior. Noted by: alfred Notes: svn path=/head/; revision=174709
* Eliminate gcc "variable clobbered" warnings by declaring the variablesDiomidis Spinellis2007-12-161-1/+2
| | | | | | | | | living across the vfork as volatile. Noted by: kan Notes: svn path=/head/; revision=174667
* When moving a directory across devices to a place where a directoryDiomidis Spinellis2007-12-161-22/+82
| | | | | | | | | | | | | | | | | | | | with the same name exists, delete that directory first, before performing the copy. This ensures that mv(1) across devices follows the semantics of rename(2), as required by POSIX. This change could introduce the potential of data loss, even if the copy fails, violating the atomicity properties of rename(2). This is (mostly) mitigated by first renaming the destination and obliterating it only after a succesfull copy. The above logic also led to the introduction of code that will cleanup the results of a partial copy, if a cross-device copy fails. PR: bin/118367 MFC after: 1 month Notes: svn path=/head/; revision=174664
* Move WARNS as ed(1) also is only WARNS = 2 clean in the !DES case.Marius Strobl2007-12-091-1/+1
| | | | | | | | | | | | This fixes its compilation if MK_OPENSSL == no and also obsoletes release/Makefile rev. 1.192. The latter isn't reverted though as support for the fixit floppy and the rest of the boot floppies is scheduled to be deorbited anyway. Discussed with: kensmith Notes: svn path=/head/; revision=174469
* Revise the markup.Ruslan Ermilov2007-12-051-275/+382
| | | | Notes: svn path=/head/; revision=174287
* Reduce the WARNS level to avoid a compiler warning about a variableJohn Birrell2007-11-181-1/+1
| | | | | | | possibly being clobbered by a longjmp or a fork with gcc4. Notes: svn path=/head/; revision=173718
* Express in the usage() and SYNOPSIS that -F depends on -s, andRuslan Ermilov2007-11-172-4/+8
| | | | | | | that -f and -i are exclusive. Notes: svn path=/head/; revision=173702
* Swap "source"/"target" where appropriate, to match documentation.Ruslan Ermilov2007-11-171-38/+38
| | | | Notes: svn path=/head/; revision=173701
* Teach ps(1) to parse pts TT values (i.e. '0', '1') for the -t flag.John Baldwin2007-11-081-9/+23
| | | | | | | | MFC after: 1 week Reported by: kris Notes: svn path=/head/; revision=173492
* Bump document date on behalf of previous revision.Ruslan Ermilov2007-11-011-1/+1
| | | | Notes: svn path=/head/; revision=173248
* fix sorting of 'tdnam' keyword in keyword list.Julian Elischer2007-10-281-2/+1
| | | | Notes: svn path=/head/; revision=173100
* Introduce a way to make pure kernal threads.Julian Elischer2007-10-264-6/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | kthread_add() takes the same parameters as the old kthread_create() plus a pointer to a process structure, and adds a kernel thread to that process. kproc_kthread_add() takes the parameters for kthread_add, plus a process name and a pointer to a pointer to a process instead of just a pointer, and if the proc * is NULL, it creates the process to the specifications required, before adding the thread to it. All other old kthread_xxx() calls return, but act on (struct thread *) instead of (struct proc *). One reason to change the name is so that any old kernel modules that are lying around and expect kthread_create() to make a process will not just accidentally link. fix top to show kernel threads by their thread name in -SH mode add a tdnam formatting option to ps to show thread names. make all idle threads actual kthreads and put them into their own idled process. make all interrupt threads kthreads and put them in an interd process (mainly for aesthetic and accounting reasons) rename proc 0 to be 'kernel' and it's swapper thread is now 'swapper' man page fixes to follow. Notes: svn path=/head/; revision=173004
* The exit status of a case statement where none of the patterns is matchedStefan Farfeleder2007-10-042-0/+5
| | | | | | | | | | | is supposed to be 0, not the status of the previous command. Reported by: Eygene Ryabinkin PR: 116559 Approved by: re (gnn) Notes: svn path=/head/; revision=172440
* Use owner name and owning group name instead of uid and gidKevin Lo2007-09-191-2/+30
| | | | | | | | | | for displaying the three-line comment header by default. Reviewed by: kientzle Approved by: re (bmah) Notes: svn path=/head/; revision=172237
* - Move all of the PS_ flags into either p_flag or td_flags.Jeff Roberson2007-09-172-7/+6
| | | | | | | | | | | | | | | | | - p_sflag was mostly protected by PROC_LOCK rather than the PROC_SLOCK or previously the sched_lock. These bugs have existed for some time. - Allow swapout to try each thread in a process individually and then swapin the whole process if any of these fail. This allows us to move most scheduler related swap flags into td_flags. - Keep ki_sflag for backwards compat but change all in source tools to use the new and more correct location of P_INMEM. Reported by: pho Reviewed by: attilio, kib Approved by: re (kensmith) Notes: svn path=/head/; revision=172207
* Take care that the input to setenv() may actually be a pointer straightSean Farley2007-07-061-14/+28
| | | | | | | | | | | from environ; make a copy before manipulating it and passing it to setenv(). Approved by: wes Approved by: re (kensmith) Notes: svn path=/head/; revision=171268
* Significantly reduce the memory leak as noted in BUGS section forSean Farley2007-07-042-7/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | setenv(3) by tracking the size of the memory allocated instead of using strlen() on the current value. Convert all calls to POSIX from historic BSD API: - unsetenv returns an int. - putenv takes a char * instead of const char *. - putenv no longer makes a copy of the input string. - errno is set appropriately for POSIX. Exceptions involve bad environ variable and internal initialization code. These both set errno to EFAULT. Several patches to base utilities to handle the POSIX changes from Andrey Chernov's previous commit. A few I re-wrote to use setenv() instead of putenv(). New regression module for tools/regression/environ to test these functions. It also can be used to test the performance. Bump __FreeBSD_version to 700050 due to API change. PR: kern/99826 Approved by: wes Approved by: re (kensmith) Notes: svn path=/head/; revision=171195
* Don't include encryption features of ed(1) when building for theKen Smith2007-07-021-0/+2
| | | | | | | | | | "rescue media" bundled with releases. Suggested by: ru Approved by: re (hrs) Notes: svn path=/head/; revision=171154
* Correct the referenced securelevel document, it's now securelevel 7.Remko Lodder2007-06-021-2/+2
| | | | | | | Pointed out by: ru Notes: svn path=/head/; revision=170215
* Fix probably copy&paste from chmod(1) - we change file flags here, not mode.Pawel Jakub Dawidek2007-05-281-1/+1
| | | | Notes: svn path=/head/; revision=170045
* Remove unnecessary free argument casts.Brian Somers2007-05-254-32/+29
| | | | | | | Don't abuse arcname's constness. Notes: svn path=/head/; revision=169993
* Cleanup pax(1) sources a little bit while I poked around in them:Ralf S. Engelschall2007-05-245-25/+25
| | | | | | | | - remove a superfluous doubled trailing semicolon. - remove the extra void casts on calls to void-function free(3). Notes: svn path=/head/; revision=169926
* In the error handling path, don't call close(fd) if the error we'reColin Percival2007-05-221-1/+2
| | | | | | | | | | | handling is that fd = open(foo) is -1. This bug is harmless since close(-1) just returns an error (which the code ignores). Found by: Coverity Prevent(tm) CID: 1503 (in userland test run) Notes: svn path=/head/; revision=169848
* Work around a vendor issue that was causing the builtin malloc to beMark Peek2007-05-162-2/+3
| | | | | | | | | used instead of the system malloc. Submitted by: ume Notes: svn path=/head/; revision=169626
* Replace a fairly opaque sentence with a much clearer wording from NetBSD.Pav Lucistnik2007-05-121-2/+2
| | | | | | | | | PR: docs/101330 (inspired by) Submitted by: Peter Gildea <peter@gildea.com> Obtained from: NetBSD Notes: svn path=/head/; revision=169510
* Back out all POSIXified *env() changes.Andrey A. Chernov2007-05-012-13/+8
| | | | | | | | | | | | Not because I admit they are technically wrong and not because of bug reports (I receive nothing). But because I surprisingly meets so strong opposition and resistance so lost any desire to continue that. Anyone who interested in POSIX can dig out what changes and how through cvs diffs. Notes: svn path=/head/; revision=169177
* Simplify previous fix and disallow VTEXTFIXED direct pass for putenv() too,Andrey A. Chernov2007-04-301-3/+3
| | | | | | | just use savestr() Notes: svn path=/head/; revision=169133
* Put some safeguards:Andrey A. Chernov2007-04-301-4/+9
| | | | | | | | | | 1) Under POSIX unsetenv("foo=bar") is explicit error and not equal to unsetenv("foo") 2) Prepare for upcomig POSIXed putenv() rewrite: make putenv() calls portable and conforming to standard. Notes: svn path=/head/; revision=169118
* Eliminate error with -W* strict flags and make putenv() calls conforming toAndrey A. Chernov2007-04-301-4/+4
| | | | | | | standard in the same way as f.e. gcc internal portable code does. Notes: svn path=/head/; revision=169112
* Move uuidgen(1) from /usr/bin/ to /bin/. It will be used in rc.d/hostidPawel Jakub Dawidek2007-04-091-0/+2
| | | | | | | | | script, which will be executed before /usr/ mount. Reviewed by: mlaier, rink, brooks, rwatson Notes: svn path=/head/; revision=168544
* getblocksize expects pointer to long as a second argument, notAlexander Kabaev2007-04-061-2/+2
| | | | | | | a pointer to u_long. Notes: svn path=/head/; revision=168428
* Build updates for tcsh-6.15.00 import.Mark Peek2007-03-112-23/+39
| | | | | | | | | Reviewed by: ume Reminded by: Divacky Roman MFC after: 1 week Notes: svn path=/head/; revision=167469
* Fix a bug where the mutual exclusivity of the -l and -t options is notWill Andrews2007-03-081-1/+4
| | | | | | | | | | recognized properly if -l is specified first. PR: bin/105721 MFC after: 1 week Notes: svn path=/head/; revision=167326
* Fix markup.Ruslan Ermilov2007-03-041-5/+8
| | | | Notes: svn path=/head/; revision=167210
* Fix markup.Ruslan Ermilov2007-03-041-16/+13
| | | | Notes: svn path=/head/; revision=167196
* Fix markup.Ruslan Ermilov2007-02-281-2/+3
| | | | Notes: svn path=/head/; revision=167105
* Fix markup.Ruslan Ermilov2007-02-271-10/+20
| | | | Notes: svn path=/head/; revision=167063
* Implement the -h flag (set an ACL on a symbolic link).Kirk McKusick2007-02-261-4/+14
| | | | | | | | | | Before this fix the -h flag was ignored (i.e. setfacl always set the ACL on the file pointed to by the symbolic link even when the -h flag requested that the ACL be set on the symbolic link itself). Notes: svn path=/head/; revision=167000
* Correct typos containing my login name (plus one more in expr.y).Ceri Davies2007-02-181-2/+2
| | | | | | | Found courtesy of a recursive grep in the wrong directory. Notes: svn path=/head/; revision=166813
* Use eaccess() instead of access() for the type builtin, like we do for theStefan Farfeleder2007-01-181-1/+1
| | | | | | | | | test builtin. Submitted by: Martin Kammerhofer Notes: svn path=/head/; revision=166101
* Return an error status (127) from the builtins 'type' and 'command' (withStefan Farfeleder2007-01-111-2/+5
| | | | | | | | | | | | | either -v or -V) if a file with a slash in the name doesn't exist (if there is no slash we already did that). Additionally, suppress the error message for command -v for files with a slash. PR: 107674 Submitted by: Martin Kammerhofer Notes: svn path=/head/; revision=165930
* Fix markup.Ruslan Ermilov2006-12-271-5/+7
| | | | Notes: svn path=/head/; revision=165564
* More markup fixes.Ruslan Ermilov2006-12-271-3/+3
| | | | Notes: svn path=/head/; revision=165563
* Fix markup.Ruslan Ermilov2006-12-271-6/+7
| | | | Notes: svn path=/head/; revision=165562