summaryrefslogtreecommitdiffstats
path: root/bin
Commit message (Collapse)AuthorAgeFilesLines
* Fix date.joel2013-01-291-1/+1
|
* Add -l option to cat(1). This option causes cat(1) to use fcntl(2) tobrooks2013-01-292-6/+30
| | | | | | | | set an exclusive advisory lock on stdout. This will be used to guarantee orderly writing to METALOG. Sponsored by: DARPA, AFRL Obtained from: NetBSD (mason)
* Return with an error from copy_link(), copy_fifo() and copy_special() ifmarkj2013-01-271-0/+17
| | | | | | | | the -n option is specified and the destination file exists. PR: bin/174489 Approved by: rstone (co-mentor) MFC after: 2 weeks
* Don't time travel back and use a present date.delphij2013-01-251-1/+1
| | | | Noticed by: mckusick
* - Wrap long line;delphij2013-01-242-2/+4
| | | | | | - Add -, to SYNOPSIS section. MFC after: 2 weeks
* Return "failure" as we do for 'cp -i' and a "n" answer.obrien2013-01-231-1/+1
| | | | | | Otherwise with '-v' we print out the file name as if it was copied: /tmp/2gb-card/M0132.CTG not overwritten /mnt/DCIM/CANONMSC/M0132.CTG -> /tmp/2gb-card/M0132.CTG
* Add FILES section.joel2013-01-221-2/+14
| | | | Discussed with: jilles
* Change the $ENV example to use .shrc instead of .shinit. This is consistentjoel2013-01-201-3/+3
| | | | | | with what we use in /usr/share/skel/dot.profile. Discussed with: jilles
* sh: Move some stackmarks to fix high memory usage in some loops.jilles2013-01-201-11/+5
| | | | | | | | | | | | If a loop contained certain commands (such as redirected compound commands), the temporary memory for the redirection was not freed between iterations of the loop but only after the loop. Put a stackmark in evaltree(), freeing memory whenever a node has been evaluated. Some other stackmarks are then redundant; remove them. Example: while :; do { :; } </dev/null; done
* sh: Remove mkinit's initialization routine.jilles2013-01-205-35/+12
| | | | Instead, call the only init function left directly from main().
* sh: Replace an mkinit use with an initialization.jilles2013-01-191-10/+5
|
* - Move 'showthreads' check out of fmt.c.jhb2013-01-192-2/+2
| | | | | - Update shadow copy of fmt_argv() prototype in w.c and fix calls for additional parameter.
* Include the thread name along with the command name when displaying thejhb2013-01-183-10/+16
| | | | | | | | | command name of a thread from a multi-threaded process that doesn't have an available argument list (such as kernel processes) and threads display is enabled via -H. Reviewed by: alfred, delphij, eric@vangyzen.net MFC after: 1 week
* Remove useless variable 'Pflag':eadler2013-01-171-7/+5
| | | | | | | -P is an alternative to -H and -L, and it is implemented using the Hflag and Lflag variables. Approved by: cperciva MFC after: 3 days
* Use a different way to silence clang analyzer as done in r245494 bydelphij2013-01-161-2/+1
| | | | | | explicitly telling the compiler that we are on the exit route. X-MFC: together with r245494
* Free memory before exiting in order to silence a warning from the clangeadler2013-01-161-0/+1
| | | | | | | static analyzer Approved by: cperciva MFC after: 3 days
* sh: Simplify cd-hash interaction.jilles2013-01-142-40/+15
| | | | | | | | Instead of rechecking relative paths for all hashed utilities after a cd, track if any utility in cmdtable depends on a relative path in PATH. If there is such a utility, cd clears the entire table. As a result, the '*' in hash no longer happens.
* sh: Pass $? to command substitution containing compound/multiple commands.jilles2013-01-141-2/+1
| | | | | Example: false; echo $(echo $?; :)
* sh: Fix crash when parsing '{ } &'.jilles2013-01-131-2/+2
| | | | MFC after: 1 week
* sh: Don't lose $? when backquoted command ends with semicolon or newline.jilles2013-01-131-1/+2
| | | | | | | | | An empty simple command was added and overwrote the exit status with 0. This affects `...` but not $(...). Example: v=`false;`; echo $?
* When WCHAR_MIN == 0 the check if a wchar_t value will always be true. Inandrew2013-01-061-1/+4
| | | | this case skip the test as gcc complains it is always true.
* Fix wording nit.gjb2012-12-281-1/+1
| | | | | | PR: 174787 Submitted by: Cody Rank MFC after: 3 days
* test(1): Document == alias for =.jilles2012-12-271-1/+8
| | | | | | Reviewed by: gjb Requested by: gjb MFC after: 1 week
* sh: Prefer strsignal() to accessing sys_siglist directly.jilles2012-12-251-8/+13
| | | | | | | | Accessing sys_siglist directly requires rtld to copy it from libc to the sh executable's BSS. Also, strsignal() will put in the signal number for unknown signals (FreeBSD-specific) so we need not do that ourselves. Unfortunately, there is no function for sys_signame.
* Fix socket calls on error post-r243965.kevlo2012-12-211-1/+1
| | | | Submitted by: Garrett Cooper
* sh: Detect and flag write errors on stdout in builtins.jilles2012-12-123-0/+22
| | | | | | | If there is a write error on stdout, a message will be printed (to stderr) and the exit status will be changed to 2 if it would have been 0 or 1. PR: bin/158206
* Use kern.max_pid sysctl to obtain maximum PID number instead of using localpjd2012-12-121-3/+17
| | | | | | define. Reviewed by: jhb
* Handle large negative block counts correctly.grog2012-12-121-1/+1
| | | | MFC after: 2 weeks
* Update man pages and clarify a number of options.grog2012-11-162-35/+65
| | | | | | Rework block count calculations to work correctly with small "block" sizes. MFC after: 14 days
* Fix section number for pstat and swapinfo cross references.pluknet2012-11-151-3/+3
| | | | MFC after: 3 days
* Follow the behavior as specified in POSIX:eadler2012-11-151-1/+1
| | | | | | | | | | | | | if (exists AND (NOT f_option) AND ((not_writable AND input_is_terminal) OR i_option)) prompt in particular, add the test for input_is_terminal PR: bin/173039 Submitted by: Mark Johnston <markjdb@gmail.com> Approved by: cperciva MFC after: 3 days
* Add , (comma) option to print sizes grouped and separated by thousandsgrog2012-11-152-16/+57
| | | | | | | using the non-monetary separator returned by localeconv(3), typically a comma or period. MFC after: 14 days
* sh: Remove an unused variable.jilles2012-11-142-2/+0
|
* sh: Forward-declare struct alias instead of giving up type safety via void *jilles2012-11-112-4/+5
|
* Undo over-aggressive conversion of spaces to tabs. ie: those withinpeter2012-11-092-6/+6
| | | | format strings, "period, space, space" in comment text, etc.
* Replace spaces with tabs where appropriate.grog2012-11-086-36/+36
| | | | Reminded by: jh@
* sh: Fix two issues when an alias is redefined:jilles2012-11-081-0/+11
| | | | | | | | | | | | | * The last character is not displayed. * If the alias ends with itself (as a word), an infinite memory-eating loop occurs. If an alias is defined initially, a space is appended to avoid recursion but this did not happen when an alias was later modified. PR: bin/173418 Submitted by: Daniel F. MFC after: 1 week
* Add y flag and environment variable LS_SAMESORT to specify the samegrog2012-11-086-21/+110
| | | | | | | | | | | | | | | | | sorting order for time and name with the -t option. IEEE Std 1003.2 (POSIX.2) mandates that the -t option sort in descending order, and that if two files have the same timestamp, they should be sorted in ascending order of their names. The -r flag reverses both of these sort orders, so they're never the same. This creates significant problems for sequentially named files stored on FAT file systems, where it can be impossible to list them in the order in which they were created. Add , (comma) option to print file sizes grouped and separated by thousands using the non-monetary separator returned by localeconv(3), typically a comma or period. MFC after: 14 days
* Sort option parsing as far as practical.grog2012-11-071-41/+42
|
* sh: Change cmdtype in tblentry from short to signed char.jilles2012-11-051-1/+1
| | | | | If this is a smaller type than int anyway, we can make it the smallest possible.
* sh: Use C99 flexible array instead of accessing array beyond bounds.jilles2012-11-031-3/+2
| | | | | | | | Although sufficient memory is available for a longer string in cmdname, this is undefined behaviour anyway. Side effect: for alignment reasons, an additional byte of memory is allocated per hashed command.
* Add a couple of examples.joel2012-11-021-1/+65
| | | | Obtained from: OpenBSD
* More -Wmissing-variable-declarations fixes.ed2012-10-201-0/+5
| | | | | | | | | | In addition to adding missing `static' keywords: - bin/dd: Pull in `extern.h' to guarantee consistency with source file. - libexec/rpc.rusersd: Move shared globals into an extern.h. - libexec/talkd: Move `debug' and `hostname' into extern.h. - usr.bin/cksum: Put counters in extern.h, as they are used by ckdist/mtree. - usr.bin/m4: Move `end_result' into extern.h. - usr.sbin/services_mkdb: Move shared globals into an extern.h.
* More -Wmissing-variable-declarations fixes.ed2012-10-196-17/+8
| | | | | | | | | | | | | | | | In addition to adding `static' where possible: - bin/date: Move `retval' into extern.h to make it visible to date.c. - bin/ed: Move globally used variables into ed.h. - sbin/camcontrol: Move `verbose' into camcontrol.h and fix shadow warnings. - usr.bin/calendar: Remove unneeded variables. - usr.bin/chat: Make `line' local instead of global. - usr.bin/elfdump: Comment out unneeded function. - usr.bin/rlogin: Use _Noreturn instead of __dead2. - usr.bin/tset: Pull `Ospeed' into extern.h. - usr.sbin/mfiutil: Put global variables in mfiutil.h. - usr.sbin/pkg: Remove unused `os_corres'. - usr.sbin/quotaon, usr.sbin/repquota: Remove unused `qfname'.
* Fix warnings found by -Wmising-variable-declarations.ed2012-10-1915-87/+90
| | | | | | | | | | | This self-written compiler warning, which is hopefully going to be committed into LLVM sources soon, warns about potentially missing `static' keywords, similar to -Wmissing-prototypes. - bin/pax: Move external declaration of chdname and s_mask into extern.h. - bin/setfacl: Move setfacl.c-specific stuff out of setfacl.h. - sbin/mount_fusefs: Remove char *progname; use getprogname(). - others: add `static' where possible.
* mdoc: don't nest displays. The markup here isn't adding anything anyway.joel2012-10-141-2/+2
| | | | | | Fixes a mandoc lint warning. Discussed with: brueffer, Jason McIntyre <jmc@kerhand.co.uk>
* Fix bin/ build with a 64-bit ino_t.mdf2012-09-273-9/+14
| | | | Original code by: Gleb Kurtsou
* - Bump date.zont2012-09-181-1/+1
| | | | | | Submitted by: pluknet Approved by: kib (mentor) X-MFC-With: r240645
* - Add 'dsiz' and 'ssiz' keywords to show data and stack size respectively.zont2012-09-182-0/+6
| | | | | Approved by: kib (mentor) MFC after: 1 week
* Revert 240527:eadler2012-09-161-1/+0
| | | | | | | mntbuf can poit to memory allocated by getmntinfo(3) which can't be freed PR: bin/171634 Approved by: cperciva (implicit)
OpenPOWER on IntegriCloud