summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2009-08-18build: perform check-AUTHORS via syntax-check, not via "make check"Jim Meyering
* src/Makefile.am (check): Don't depend on check-AUTHORS. That check fails on systems for which a program like stdbuf is not built. Instead, move this check to "make syntax-check". (sc_check-AUTHORS): Rename rule from check-AUTHORS. * cfg.mk (sc_check-AUTHORS): New rule. Reported by Berhnard Voelker.
2009-08-18sort: use more portable initialization syntaxJim Meyering
* src/sort.c (find_unit_order): Spell out 256-element static initializer, rather than relying on C99 syntax. Required for Forte Developer 7 C 5.4 2002/03/09 on Solaris 10. Reported by Bernhard Voelker.
2009-08-14cp,mv: fix issues with preserving timestamps of copied symlinksPádraig Brady
* src/copy.c (copy_internal): On systems without utimensat don't use utimens on a symlink, as that would dereference the symlink. * tests/cp/abuse: To work around possible attribute preservation failures breaking the test, use cp -dR rather than cp -a.
2009-08-13tail: fix tail -f failure when inotify usedPádraig Brady
* src/tail.c (tail_forever_inotify): Remove the redundant and incorrect error check of the return from inotify_add_watch(). Also initialize the wd member of each File_spec to an invalid value. Reported by C de-Avillez.
2009-08-13dd: fix a signal handling racePádraig Brady
* src/dd.c (main): Install the signal handlers at startup rather than just before the copy starts. In this way signals received before the copy (like during a slow truncate for e.g.) will be deferred and handled consistently. * THANKS: Add Bernhard's email address. * NEWS: Mention the fix. Reported by Bernhard Voelker.
2009-08-10nl, pinky: replace uses of strcatJim Meyering
* src/nl.c (main): Avoid strcat, on principle. Use stpcpy instead. * src/pinky.c (print_long_entry): Likewise.
2009-08-07cp: accept the --reflink optionGiuseppe Scrivano
* NEWS: Mention it. * doc/coreutils.texi (cp invocation): Describe it. * src/copy.h (struct cp_options) [reflink]: New member. * src/copy.c (usage): Describe it. (copy_reg): If reflink is true try to clone the file. (main): Check for --reflink. (cp_option_init): Initialize the new member. * src/install.c (cp_option_init): Initialize the new member. * src/mv.c (cp_option_init): Likewise. * tests/cp/sparse: Add a new test case.
2009-08-07dd: preserve semantics of O_DIRECT even for final blockJim Meyering
* src/dd.c: Include "ignore-value.h" (iwrite): When disabling O_DIRECT, try to compensate via POSIX_FADV_DONTNEED and fsync. Suggested by Eric Sandeen.
2009-08-06dd: work around buffer length restrictions with oflag=direct (O_DIRECT)Jim Meyering
dd oflag=direct would fail to copy a file with size that is not a multiple of 512 (destination file system specific) * NEWS (Bug fixes): Mention it. * src/dd.c (iwrite): Turn off O_DIRECT for any smaller-than-obs-sized write. Don't bother to restore it. * tests/dd/direct: New test for the above. * tests/Makefile.am (TESTS): Add dd/direct. * doc/coreutils.texi (dd invocation): Mention oflag=direct buffer size restriction. Details in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/17586 Reported by Eric Sandeen.
2009-08-04dd: remove unnecessary #if HAVE_FTRUNCATEJim Meyering
* src/dd.c (main): Remove unnecessary cpp directives. Gnulib guarantees that ftruncate is usable.
2009-08-04cp -pP (and e.g., -a): preserve time stamps on symlinks, tooJim Meyering
* src/copy.c (utimensat_if_possible): New function. (copy_internal): Remove variable, "preserve_metadata". Replace with "dest_is_symlink". That covers all cases but one: the one in which cp --link has created hard links to non-directories. In that case, there is no need to update attributes of the links. Use utimensat_if_possible, to preserve timestamps of symlinks. * NEWS (New features): Mention this. * tests/Makefile.am (TESTS): Add cp/preserve-slink-time. * tests/cp/preserve-slink-time: New file. * m4/jm-macros.m4 (coreutils_MACROS): Test for utimensat. Reported in http://bugzilla.redhat.com/230866
2009-07-30tail: tweak indentationJim Meyering
* src/tail.c (tail_forever_inotify): Adjust indentation of continued line.
2009-07-30tail: properly parse fractional seconds when monitoring a pidPádraig Brady
* src/tail.c (tail_forever_inotify): The fractional part of the delay was 1000 times too large. * tests/tail-2/pid: Add a test to ensure the timeout happens for this case.
2009-07-30tail: exit successfully upon watched process deathGiuseppe Scrivano
* src/tail.c (tail_forever_inotify): If a PID is specified and the watched process dies, exit with status EXIT_SUCCESS, rather than falling through to an EXIT_FAILURE.
2009-07-29cp: support btrfs' copy-on-write file clone operationGiuseppe Scrivano
* src/copy.c [HAVE_SYS_IOCTL_H]: Include <sys/ioctl.h>. (BTRFS_IOCTL_MAGIC, BTRFS_IOC_CLONE): Define. (clone_file): New function. (copy_reg): Use the btrfs clone operation if possible.
2009-07-29maint: update sleep.c's copyright year listJim Meyering
* src/sleep.c: Update copyright year list to include 2009. * tests/sort-time/rand-gen: Remove long-unused file. * tests/sort-time/README: Likewise.
2009-07-28tail: use the inotify backend also with --pid=PIDGiuseppe Scrivano
* src/tail.c (tail_forever_inotify): When a PID is specified, use select to block for no more than sleep_interval seconds at a time, and check for process death upon timeout. (main): Adapt to new tail_forever_inotify interface.
2009-07-27ls -1U dir arg ... now works againKamil Dudka
* src/ls.c (print_dir): Emit "$dir_name:\n" *before* accumulating (and possibly printing) directory entry names. The bug was introduced in coreutils-7.0 via commit 8d974b00, 2008-07-30, "ls -U1 now uses constant memory". Reported by Julian Bradfield. * NEWS (Bug fixes): Mention it.
2009-07-27tr: improve --help's description of --complement (-c)Heikki Orsila
2009-07-24readlink: improve one-line summary: prints canonical file names, tooJim Meyering
* src/readlink.c (usage): Adjust one-line summary. * man/readlink.x: Likewise. Suggested by Kamil Dudka.
2009-07-11tail: adjust type of a local variableJim Meyering
* src/tail.c (tail_forever_inotify): Declare "len" to be of type size_t, not ssize_t, since the former is what safe_read returns.
2009-07-08copy.c: remove a duplicate expressionOndřej Vašík
* src/copy.c (copy_attr_error): remove a redundant expression added in commit e0cf592f, 2009-04-27, "factor out test for errno ...".
2009-07-08tail: use size_t for counter and index variables, ...Jim Meyering
* src/tail.c (any_live_files): ... not "int" or even unsigned int (tail_forever, tail_forever_inotify, main): Likewise.
2009-07-08tail: declare "file descriptor" variable to be "int", not size_tJim Meyering
* src/tail.c (tail_forever_inotify): Use "int", not size_t as the type of a file descriptor variable.
2009-07-03sort: allow SI and IEC units on separate human sort fieldsPádraig Brady
* src/sort.c: Store the si_present state per key rather than globally * tests/misc/sort: Add a check that would have previously failed. Also add a test to demonstrate that invalid IEC/SI mixtures are not always noticed when they're not significant to the sort.
2009-07-03tail: avoid an inotify portability problem in kernels prior to 2.6.21Giuseppe Scrivano
* src/tail.c (tail_forever_inotify): Handle the special case in which an old inotify watcher returns 0. Affects kernels in [2.6.13, 2.6.21).
2009-06-29tail: add comments noting potential inotify-related problemsJim Meyering
* src/tail.c (tail_forever_inotify): Add two FIXME comments.
2009-06-27stdbuf: fix to stop -i option causing an assertionPádraig Brady
* src/stdbuf.c (main): Fix the array bounds check in the assert * tests/misc/stdbuf: Add a test for all standard streams
2009-06-23maint: update all Copyright year lists to include 2009Jim Meyering
2009-06-17stdbuf: A new program to run a command with modified stdio bufferingPádraig Brady
* AUTHORS: Register as the author. * NEWS: Mention this change. * README: Add stdbuf command to list. * configure.ac: Only enable on ELF systems with GCC. * cfg.mk (sc_system_h_headers): Use VC_LIST_EXCEPT rather than VC_LIST, so we can add an exception, if needed. * .x-sc_system_h_headers: New file. Exempt libstdbuf.c. * Makefile.am (syntax_check_exceptions): Add .x-sc_system_h_headers. * doc/coreutils.texi (stdbuf invocation): Add stdbuf info. * man/.gitignore: Ignore generated manpage. * src/.gitignore: Ignore stdbuf and libstdbuf.so binaries. * man/Makefile.am (stdbuf.1): Add dependency. * man/stdbuf.x: New file with example usage. * po/POTFILES.in: Reference new command and shared library sources. * src/Makefile.am (build_if_possible__progs): Add stdbuf and libstdbuf, (pkglib_PROGRAMS): Reference optional shared lib, (libstdbuf_so_LDADD): Ensure we don't link with non PIC libcoreutils.a. (libstdbuf_so_LDFLAGS): Add -shared GCC option, (libstdbuf_so_CFLAGS): Add -fPIC GCC option. (check-README): Exclude libstbuf. (check-AUTHORS): ditto. (sc_tight_scope): Exclude functions starting with __. * src/libstdbuf.c: The LD_PRELOAD shared library to control buffering. * src/stdbuf.c: New file to setup env variables before execing command. * tests/Makefile.am: Reference new test file. * tests/misc/help-version: Set expected exit codes. * tests/misc/invalid-opt: ditto. * tests/misc/stdbuf: Add 9 tests.
2009-06-15tail: use inotify if it is availableGiuseppe Scrivano
* NEWS: Document the new feature. * m4/jm-macros.m4: Check if inotify is present. * src/tail.c (tail_forever_inotify): New function. (main): Use the inotify-based function, if possible. * tests/Makefile.am: Add new tests for tail. * tests/test-lib.sh (require_proc_pid_status_, get_process_status_): New functions. * tests/tail-2/pid: New file. * tests/tail-2/wait: New file. * tests/tail-2/tail-n0f: Refactor code into the test-lib.sh require_proc_pid_status_ function.
2009-06-13diag: say "failed to...", rather than "cannot..." in a few diagnosticsJim Meyering
* src/chroot.c (main): ...it's more precise. * src/nohup.c (main): Likewise. * src/setuidgid.c (main): Likewise. * src/timeout.c (main): Likewise.
2009-06-13sort: Ignore fields where end position is before the start positionCliff Miller
* NEWS: Mention the fix * THANKS: Add Cliff Miller * src/sort.c (keycompare): Ensure lima >= texta * tests/misc/sort: Add 3 corresponding tests Signed-off-by: Pádraig Brady <P@draigBrady.com>
2009-06-11ls --color: do not colorize files with multiple hard links by defaultKamil Dudka
* src/ls.c: Rename hl->mh, do not colorize files with multiple hard links by default. * src/dircolors.c: Rename HARDLINK -> MULTIHARDLINK, hl -> mh. * src/dircolors.hin: Do not colorize files with multiple hard links by default. * tests/Makefile.am: Rename the test case accordingly. * tests/ls/multihardlink: Additionally test ls' default behavior and factor out some duplication. * NEWS: Mention the change in behavior.
2009-06-07sort: die immediately upon heap allocation failureJim Meyering
* src/sort.c (register_proc): Handle hash_insert failure.
2009-06-04dircolors: add screen-256color-bce to TERM listMike Frysinger
* src/dircolors.hin: Add screen-256color-bce.
2009-06-03dircolors: recognize .xz, .txz, .tbz and .tlz suffixesJim Meyering
* src/dircolors.hin: Add .xz, .txz, .tbz and .tlz.
2009-06-02chroot: make --groups= work without --userspec=; be more robustJim Meyering
* src/chroot.c (set_additional_groups): Add comments. Given an empty or all-comma group list, diagnose it and return nonzero. When more than one group is invalid, diagnose all of them, not just the first. (main): Honor --groups= also when --userspec= is not specified. Now that set_additional_groups consistently diagnoses its failures, don't diagnose it separately here. * tests/chroot/credentials: Do not invoke with an empty group list.
2009-06-02chroot: don't set bogus user-ID or group-ID for --u=U: or --u=:GJim Meyering
* src/chroot.c (main): Initialize both "uid" and "gid". To -1. This also allows one to set the user-ID or primary group-ID to 0, in case it's not that already. * tests/chroot/credentials: Test for the above.
2009-06-02chroot: set-*-ID failure must provoke nonzero exit before execvpJim Meyering
* src/chroot.c (main): Exit upon set-group-ID or set-user-ID failure.
2009-05-29head, tail: make --help less ambiguousEric Blake
* src/head.c (usage): Use -n K, not -n N, to avoid confusion. * src/tail.c (usage): Likewise. * doc/coreutils.texi (head invocation, tail invocation): Likewise. Reported by Christophe Lyon.
2009-05-26sort: new --human-numeric-sort option to sort KiB MB etc.Michael Speer
* NEWS: Document the new option * doc/coreutils.texi (sort invocation): ditto * src/sort.c (main): handle the new --human-numeric-sort option (-h). (human_numcompare): A new function to compare SI and IEC suffixes before falling back to the standard --numeric comparison. (find_unit_order): A new helper function to find the order of magnitude of a number string as determined by its suffix. (check_mixed_SI_IEC): A new helper function to exit with error if both SI and IEC suffixes are presented. * tests/misc/sort: Add 8 tests to test the new functionality. * THANKS: Update
2009-05-26chroot: accept new options --userspec=U:G and --groups=G1,G2,G3Giuseppe Scrivano
* NEWS: Note chroot's new options. * doc/coreutils.texi: Document them. * src/chroot.c (main): Add support for --userspec and --groups. * tests/Makefile.am (root-tests): Add chroot/credentials. * tests/chroot/credentials: New file. * tests/test-lib.sh: Define NON_ROOT_GROUP to a default value.
2009-05-18doc: clarify the operation of the comm -123 parametersPádraig Brady
* src/comm.c (usage): give more information on the -123 parameters, with examples to show that they can be combined. Addresses <http://savannah.gnu.org/bugs/?24974>. * doc/coreutils.texi (comm invocation): Mention that the column separators are suppressed along with the column. Suggestion from Dan Jacobson. * man/comm.x: Reference other commands that match adjacent lines. * man/join.x: ditto. * man/uniq.x: ditto.
2009-05-17maint: use ARRAY_CARDINALITY moreJim Meyering
* src/sort.c (main): Use ARRAY_CARDINALITY, rather than open-coding it. * src/factor.c (WHEEL_END): Likewise. * src/csplit.c (main): Likewise. * src/od.c: Likewise, * src/ls.c (main): Likewise. (N_ENTRIES): Remove definition. Use ARRAY_CARDINALITY instead. * src/dircolors.c: Likewise. (array_len): Remove definition.
2009-05-17build: tr: avoid a warning due to newer gcc's -Wenum-compareJim Meyering
* src/tr.c (N_CHAR_CLASSES): Remove anonymous enum definition. (look_up_char_class): Use ARRAY_CARDINALITY, rather than N_CHAR_CLASSES.
2009-05-17maint: define ARRAY_CARDINALITY in system.hJim Meyering
* src/system.h (ARRAY_CARDINALITY): Define if not already defined.
2009-05-11truncate: fix bug in use of isspaceEric Blake
* src/truncate.c (main): Pass unsigned characters to isspace. * NEWS: Mention this.
2009-05-05doc: note the use of LC_COLLATE in comm, join and uniqPádraig Brady
* doc/coreutils.texi (uniq invocation): Simplify the text to remove the inconsequential mentioning of order, while implying that LC_COLLATE can alter equality comparisons. * src/comm.c (usage): Mention LC_COLLATE is significant. * src/join.c (usage): Ditto. * src/uniq.c (usage): Ditto. Also improve the summary. Suggestion from Andries Brouwer
2009-05-05tests: fix typo in check-AUTHORS ruleAndreas Schwab
* src/Makefile.am (check-AUTHORS): Set locale.