aboutsummaryrefslogtreecommitdiff
path: root/bin
Commit message (Collapse)AuthorAgeFilesLines
* Convert to use libxo. Document use of libxo as well.Marcel Moolenaar2015-05-226-166/+253
| | | | | | | | Obtained from: Phil Shafer <phil@juniper.net> Sponsored by: Juniper Networks, Inc. Notes: svn path=/head/; revision=283304
* Eliminate unneeded includes.Xin LI2015-05-2112-17/+1
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=283257
* date(1): Make -r behave like GNU's version when the option can not beXin LI2015-05-072-4/+13
| | | | | | | | | | | | interpreted as a number, which checks the file's modification time and use that as the date/time value. This improves compatibility with GNU coreutils's version of time(1). MFC after: 2 weeks Notes: svn path=/head/; revision=282608
* cp: Remove fts sorting.Jilles Tjoelker2015-05-051-28/+1
| | | | | | | | | | | | | | | | | | | | | | | | | In an attempt to improve performance, cp reordered directories first (although the comment says directories last). This is not effective with new UFS layout policies. The sorting reorders multiple arguments passed to cp, which may be undesirable. Additionally, the comparison function does not induce a total order. Per POSIX, this causes undefined behaviour in qsort(). NetBSD removed the sorting in 2009. On filesystems that return directory entries in hash/btree order, sorting by d_fileno before statting improves performance on large directories. However, this can only be implemented in fts(3). PR: 53475 Reviewed by: bde (in 2004) MFC after: 1 week Notes: svn path=/head/; revision=282482
* Standardise chmod, chflags, chown and chgrp recursive symlink processingSteven Hartland2015-04-294-80/+90
| | | | | | | | | | | | | | chmod, chflags, chgrp, chmod and chown now affect symlinks in -R mode as defined in symlink(7); previously symlinks were silently ignored. Differential Revision: https://reviews.freebsd.org/D2316 Reviewed by: jilles MFC after: 1 month Relnotes: yes Sponsored by: Multiplay Notes: svn path=/head/; revision=282208
* Pet manlintBaptiste Daroussin2015-04-261-1/+1
| | | | Notes: svn path=/head/; revision=282002
* Use mdoc(7) macros for curly bracesBaptiste Daroussin2015-04-261-3/+3
| | | | Notes: svn path=/head/; revision=281998
* mdoc: escape ReBaptiste Daroussin2015-04-261-1/+1
| | | | Notes: svn path=/head/; revision=281997
* sh: Pass along SIGINT from a child if job control is enabled, even when notJilles Tjoelker2015-04-251-1/+1
| | | | | | | | | | | | interactive. I added the interactive check in r208881 to be safe, but in actual use (scripts in set -m mode) passing along SIGINT seems best. Discussed with: bdrewery Notes: svn path=/head/; revision=281982
* ed(1): Fix [-Werror=logical-not-parentheses]Eitan Adler2015-04-201-1/+1
| | | | | | | | | | | /usr/src/bin/ed/glbl.c:64:36: error: logical not is only applied to theleft hand side of comparison [-Werror=logical-not-parentheses] Obtained from: Dragonfly (1fff89cbaeaa43af720a1f23d9c466b756dd8a58) MFC After: 1 month Notes: svn path=/head/; revision=281758
* bin/ed: use correct type in multiplicationEitan Adler2015-04-181-1/+1
| | | | | | | | | | The result is line_t** so the multiplication should be size * sizeof(line_t*) MFC After: 1 month Notes: svn path=/head/; revision=281719
* sh: Fix the trap builtin to be POSIX-compliant for 'trap exit SIG' and 'trap ↵Bryan Drewery2015-04-185-4/+30
| | | | | | | | | | | | | | | | | | | | n n...'. The parser considered 'trap exit INT' to reset the default for both EXIT and INT. This beahvior is not POSIX compliant. This was avoided if a value was specified for 'exit', but then disallows exiting with the signal received. A possible workaround is using ' exit'. However POSIX does allow this type of behavior if the parameters are all integers. Fix the handling for this and clarify its support in the manpage since it is specifically allowed by POSIX. Differential Revision: https://reviews.freebsd.org/D2325 Reviewed by: jilles MFC after: 2 weeks Notes: svn path=/head/; revision=281718
* Fix build after r281550 when WITHOUT_ICONV is defined.Tijl Coosemans2015-04-161-1/+1
| | | | | | | | Reported by: adrian MFC after: 2 weeks Notes: svn path=/head/; revision=281591
* Remove the const qualifier from iconv(3) to comply with POSIX:Tijl Coosemans2015-04-151-1/+1
| | | | | | | | | | | | | http://pubs.opengroup.org/onlinepubs/9699919799/functions/iconv.html Adjust all code that calls iconv. PR: 199099 Exp-run by: antoine MFC after: 2 weeks Notes: svn path=/head/; revision=281550
* sh: Add more tests for exotic IFS splitting.Jilles Tjoelker2015-03-313-0/+13
| | | | Notes: svn path=/head/; revision=280920
* cp,mv: Use futimens() instead of utimensat() if possible.Jilles Tjoelker2015-03-232-2/+2
| | | | Notes: svn path=/head/; revision=280386
* Build expr with -fwrapv, since it relies on signed integer wrappingDimitry Andric2015-03-221-0/+3
| | | | | | | | | | having defined behavior. Reported by: rodrigc MFC after: 3 days Notes: svn path=/head/; revision=280357
* Implement pax -O option to permit limiting a PAX archive to a single volume.Eitan Adler2015-03-185-16/+32
| | | | | | | | | | | | -O Force the archive to be one volume. If a volume ends prematurely, pax will not prompt for a new volume. PR: 198481 Submitted by: Sevan Janiyan Reviewed by: allanjude (doc) Notes: svn path=/head/; revision=280206
* Use 24h timestamps in the ps(1) STARTED columnMark Felder2015-03-172-9/+4
| | | | | | | | | | | | | | | | | | | | | | | | The previous 12h AM/PM format was perplexing as it didn't follow the locale of the user and was a minor annoyance to FreeBSD users coming from Linux. Additionally, the man page was incorrect about the strftime format. There are three time formats that may be displayed in the STARTED column depending on the age of the process. Below is an example. For a process started at 14:30 on Monday 16 March 2015, the following formats may be used: 14:30 for process < 24h old (24h Timestamp) Mon14 for process > 24h, < 1 week old (Weekday Hour) 16Mar15 for process > 1 week old (Day Month Year) Differential Revision: https://reviews.freebsd.org/D1620 Reviewed by: brd Approved by: trasz Notes: svn path=/head/; revision=280171
* r* commands are not precious anymoreBaptiste Daroussin2015-03-041-1/+0
| | | | Notes: svn path=/head/; revision=279603
* sh: Fix more compiler warnings related to variable declarations.Jilles Tjoelker2015-03-035-6/+7
| | | | Notes: svn path=/head/; revision=279569
* sh: Fix more compiler warnings.Jilles Tjoelker2015-03-016-13/+20
| | | | Notes: svn path=/head/; revision=279508
* sh: Fix compiler warnings related to duplicate or missing declarations.Jilles Tjoelker2015-03-016-8/+6
| | | | Notes: svn path=/head/; revision=279503
* Fix unitialized variable that broke sh on PowerPC starting with r278826.Nathan Whitehorn2015-02-261-1/+1
| | | | Notes: svn path=/head/; revision=279330
* sh: Add details about importing the environment and initializing OPTIND.Jilles Tjoelker2015-02-221-7/+14
| | | | Notes: svn path=/head/; revision=279188
* Disguising stderr from jls generally considered harmfulEnji Cooper2015-02-212-2/+4
| | | | | | | | | | | Undisguising it dumps out the following logspew: jls: unknown parameter: allow PR: 191019 Notes: svn path=/head/; revision=279121
* symlink(7): Mention chflagsat() (can take AT_SYMLINK_NOFOLLOW).Jilles Tjoelker2015-02-161-1/+2
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=278848
* sh: Various cleanups to expand.c:Jilles Tjoelker2015-02-151-60/+55
| | | | | | | | | * Remove some gotos. * Remove unused parameter. * Remove duplicate code. Notes: svn path=/head/; revision=278826
* sh: Prefer "" to nullstr where possible.Jilles Tjoelker2015-02-158-9/+8
| | | | Notes: svn path=/head/; revision=278820
* sh: Add stsavestr(), like savestr() but allocates using stalloc().Jilles Tjoelker2015-02-154-12/+16
| | | | Notes: svn path=/head/; revision=278818
* sh: Add simple tests for globbing/splitting command substitution.Jilles Tjoelker2015-02-153-0/+9
| | | | Notes: svn path=/head/; revision=278806
* Refactor pkill-j_test to reflect the relevant changes done to pgrep-j_testEnji Cooper2015-02-141-75/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r278742: Simplify jail_name_to_jid and try to be more fault tolerant when scanning for the jail ID (poll up to 10 times for the jail IDs to become available) If the scan fails, the code will fall through and fail as it does with Jenkins today r278636: Parameterize out the amount of sleep done in each test Set the value in each test to a different amount to avoid potential side-effects with other instances of the test (or lingering processes) still being present on the system r278633: Refactor the tests 1. `id -u` -> 0 is now only checked once; the entire test script is now skipped if this assertion is violated 2. De-dent whitespace, based on 1. 3. Only setup the symlink for $sleep once at the top of the script, and tear it down once at the bottom of the script Notes: svn path=/head/; revision=278776
* Simplify jail_name_to_jid and try to be more fault tolerant when scanning forEnji Cooper2015-02-141-15/+14
| | | | | | | | | | the jail ID (poll up to 10 times for the jail IDs to become available) If the scan fails, the code will fall through and fail as it does with Jenkins today Notes: svn path=/head/; revision=278742
* Call wait to ensure that background processes have diedEnji Cooper2015-02-131-0/+2
| | | | | | | This is being done to establish parity with pgrep-j_test Notes: svn path=/head/; revision=278653
* Parameterize out the amount of sleep done in each testEnji Cooper2015-02-121-9/+12
| | | | | | | | | Set the value in each test to a different amount to avoid potential side-effects with other instances of the test (or lingering processes) still being present on the system Notes: svn path=/head/; revision=278636
* Refactor the testsEnji Cooper2015-02-121-59/+48
| | | | | | | | | | | 1. `id -u` -> 0 is now only checked once; the entire test script is now skipped if this assertion is violated 2. De-dent whitespace, based on 1. 3. Only setup the symlink for $sleep once at the top of the script, and tear it down once at the bottom of the script Notes: svn path=/head/; revision=278633
* Add debugging output to help track down the recent Jenkins failuresEnji Cooper2015-02-121-3/+3
| | | | Notes: svn path=/head/; revision=278618
* Prevent access to an uninitialized variablePedro F. Giffuni2015-01-311-1/+1
| | | | | | | | | | The "-h" option may access an uninitialized value. Prevent it by properly initializing the value. CID: 1006559 Notes: svn path=/head/; revision=277979
* sh: Abort a wait builtin on any trapped signal.Jilles Tjoelker2015-01-312-5/+6
| | | | | | | | | | | This is required by POSIX. PR: 197210 Reported by: ache MFC after: 2 weeks Notes: svn path=/head/; revision=277973
* Fix overflow check for multiplication:Stefan Eßer2015-01-271-4/+16
| | | | | | | | | | | | | | | | - Add special test to detect the case of -1 * INTMAX_MIN - Protect against elimination of the test division by the optimizer Garrett Cooper noticed that the overflow checks were incomplete, and Bruce Evans suggested the use of the "volatile" qualifier to counter the effect of the undefined behaviour, when the prior multiplication caused overflow, and he also suggested improvements to the comments. Reviewed by: bde MFC after: 1 week Notes: svn path=/head/; revision=277798
* cp,mv,touch: Set timestamps with nanosecond precision.Jilles Tjoelker2015-01-242-10/+10
| | | | | | | This uses utimensat(). Notes: svn path=/head/; revision=277645
* Add futimens and utimensat system calls.Jilles Tjoelker2015-01-231-3/+4
| | | | | | | | | | | | | | | | | The core kernel part is patch file utimes.2008.4.diff from pluknet@FreeBSD.org. I updated the code for API changes, added the manual page and added compatibility code for old kernels. There is also audit and Capsicum support. A new UTIME_* constant might allow setting birthtimes in future. Differential Revision: https://reviews.freebsd.org/D1426 Submitted by: pluknet (partially) Reviewed by: delphij, pluknet, rwatson Relnotes: yes Notes: svn path=/head/; revision=277610
* Don't include newvers.sh into freebsd-version.Hajimu UMEMOTO2015-01-221-1/+1
| | | | Notes: svn path=/head/; revision=277531
* Integrate contrib/netbsd-tests/bin/expr into the build/kyua as bin/expr/testsEnji Cooper2015-01-192-0/+22
| | | | | | | | MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=277358
* Add a ${CP} alias for copying files in the build.Will Andrews2015-01-161-1/+1
| | | | | | | | | | | | | | | | | Some users build FreeBSD as non-root in Perforce workspaces. By default, Perforce sets files read-only unless they're explicitly being edited. As a result, the -f argument must be used to cp in order to override the read-only flag when copying source files to object directories. Bare use of 'cp' should be avoided in the future. Update all current users of 'cp' in the src tree. Reviewed by: emaste MFC after: 1 week Sponsored by: Spectra Logic Notes: svn path=/head/; revision=277273
* Install d_align.{in,out} for the :align testEnji Cooper2015-01-051-0/+5
| | | | | | | | X-MFC with: r276669 Pointyhat to: me Notes: svn path=/head/; revision=276723
* Integrate bin/cat/tests from NetBSD into atf/kyuaEnji Cooper2015-01-042-0/+19
| | | | | | | Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=276669
* symlink(7): Note that stat(1) does not follow symlinks by default.Jilles Tjoelker2014-12-291-9/+8
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=276359
* sh: Move some code from onint() to onsig(), making onint() noreturn.Jilles Tjoelker2014-12-214-21/+21
| | | | | | | | As a result, the INTON macro which is used many times generates fewer bytes of code. Notes: svn path=/head/; revision=276038
* sh: Remove EXP_REDIR.Jilles Tjoelker2014-12-213-15/+8
| | | | | | | | | | | | | EXP_REDIR was supposed to generate pathnames in redirection if exactly one file matches, as permitted but not required by POSIX in interactive mode. It is unlikely this will be implemented. No functional change is intended. MFC after: 1 week Notes: svn path=/head/; revision=276037