summaryrefslogtreecommitdiffstats
path: root/bin
Commit message (Collapse)AuthorAgeFilesLines
...
* 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)
* sh: Prefer internal nextopt() to libc getopt().jilles2012-09-155-83/+37
| | | | | | | | | This reduces code duplication and code size. /usr/bin/printf is not affected. Side effect: different error messages when certain builtins are passed invalid options.
* Free memory before exiting in order toeadler2012-09-141-0/+1
| | | | | | | | | help tools understand that we're not leaking it. PR: bin/171634 Submitted by: Erik Cederstrand <erik@cederstrand.dk> Approved by: cperciva MFC after: 3 days
* sh: Reduce code duplication: use setinputfile instead of open/setinputfdjilles2012-09-141-8/+1
| | | | | | combination. MFC after: 2 weeks
* Minor mdoc fix.joel2012-09-111-1/+2
|
* sh: Remove XXX comment about removing nextopt().jilles2012-09-081-4/+0
| | | | | Using nextopt() avoids depending on the BSD-specific optreset feature in getopt() and reduces code size (both source and binary).
* Use "e.g.", not "i.e.", to introduce an example.kevlo2012-09-071-1/+1
| | | | Obtained from: NetBSD
* Explicitly mention that "cp -p" copies ACLs.trasz2012-09-041-2/+2
| | | | | PR: docs/168962 MFC after: 1 month
* Fix an error in setfacl(1) that manifested like this:trasz2012-09-041-3/+4
| | | | | | | | | | | | | | | | | | | | | | | # setfacl -m u:trasz:rwx x # setfacl -m u:root:rwx x # getfacl x # file: x # owner: root # group: wheel user::rw- user:root:rwx user:trasz:rwx group::r-- mask::rwx other::r-- # setfacl -m u:root:rwx x setfacl: x: acl_calc_mask() failed: Invalid argument setfacl: x: failed to set ACL mask For NFSv4 ACLs, this sort of situation would result in duplicated entries. MFC after: 1 month
* In getfacl(1) manual page, mention where to read about the ACL syntax.trasz2012-09-041-0/+4
| | | | | | | | PR submitter suggested adding it to acl(3) instead, but I don't think pointing ordinary users at section 3 is a good idea. PR: docs/162380 MFC after: 1 month
* Make "setfacl -bd" an alias for "setfacl -k". Previously it would crashtrasz2012-09-041-0/+11
| | | | | | | on assert. PR: bin/165807 MFC after: 1 month
OpenPOWER on IntegriCloud