summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2010-05-03maint: remove now-redundant definitions provided by signal.hJim Meyering
* src/dd.c (SA_NODEFER, SA_RESETHAND): Remove definitions, now that gnulib guarantees they are defined in <signal.h>. * src/ls.c (SA_RESTART): Likewise.
2010-05-03maint: remove now-redundant definitions provided by sys/wait.hJim Meyering
* src/timeout.c (WIFSIGNALED, WTERMSIG): Remove definitions, now that gnulib guarantees they are defined in <sys/wait.h>. * src/operand2sig.c: Likewise. * src/kill.c: Likewise.
2010-05-01sort: use long doubles only when effectivePaul Eggert
* src/sort.c (general_numcompare): Don't use long double if strtold is not available, as it may introduce needless overhead.
2010-04-29sort: use long doubles for general numeric modePádraig Brady
* src/sort.c (general_numcompare): Use long doubles unconditionally, and strtold when available, to convert numbers with greater range and precision. Performance was seen to be on par with standard doubles. * doc/coreutils.texi (sort invocation): Amend the -g description to mention long double rather than double, and strtold rather than strtod. * src/getlimits.c (main): Output floating point limits for use in tests. * tests/misc/sort-float: A new test to ensure sort is using long doubles when possible, and that locale specific floats are handled. * tests/Makefile.am: Reference the new test. * tests/test-lib.sh (getlimits_): Normalize indenting. * NEWS: Mention the new behaviour. Reported by Nelson Beebe.
2010-04-24maint: remove now-unnecessary #if HAVE_header_H tests.Jim Meyering
* .x-sc_prohibit_always_true_header_tests: New file. * Makefile.am (syntax_check_exceptions): Add it. * src/cat.c: Remove #if HAVE_SYS_IOCTL_H test. * src/copy.c: Likewise. * src/ls.c: Likewise. * src/stty.c: Likewise. * src/install.c: Remove #if HAVE_SYS_WAIT_H test. * src/kill.c: Likewise. * src/operand2sig.c: Likewise. * src/timeout.c: Likewise. * src/pathchk.c: Remove #if HAVE_WCHAR_H test. * src/stat.c: Remove #if HAVE_NETINET_IN_H test.
2010-04-23tests: fix exit status of signal handlers in shell scriptsDmitry V. Levin
The value of `$?' on entrance to signal handlers in shell scripts cannot be relied upon, so set the exit code explicitly. * cfg.mk (sc_always_defined_macros, sc_system_h_headers): Set the exit code in signal handler explicitly to 128 + SIG<SIGNAL>. * src/Makefile.am (sc_tight_scope): Likewise. * tests/test-lib.sh: Likewise.
2010-04-22base64: always treat input in binary modeEric Blake
Necessary for cygwin. Technically, this patch is not correct, in that it clobbers O_APPEND, but it is no different than any other use of xfreopen to force binary mode, so all such uses should be fixed at once in a later patch. * src/base64.c (main): Open input in binary mode. * THANKS: Update. Reported by Yutaka Amanai.
2010-04-20sort: fix parsing of end field in obsolescent key formatsPádraig Brady
This regression was introduced in commit 224a69b5, 2009-02-24, "sort: Fix two bugs with determining the end of field". The specific regression being that we include 1 field too many when an end field is specified using obsolescent key syntax (+POS -POS). * src/sort.c (struct keyfield): Clarify the description of the eword member, as suggested by Alan Curry. (main): When processing obsolescent format key specifications, normalize eword to a zero based count when no specific end char is given for an end field. This matches what's done when keys are specified with -k. * tests/misc/sort: Add a few more tests for the obsolescent key formats, with test 07i being the particular failure addressed by this change. * THANKS: Add Alan Curry who precisely identified the issue. * NEWS: Mention the fix. Reported by Santiago Rodríguez
2010-04-16cp: preserve "capabilities" when also preserving file ownershipPádraig Brady
* src/copy.c (copy_reg): Copy xattrs _after_ setting file ownership so that capabilities are not cleared when setting ownership. * tests/cp/capability: A new root test. * tests/Makefile.am (root_tests): Reference the new test. * NEWS: Mention the fix.
2010-04-16maint: fix build on platforms that replace strsignalPádraig Brady
* src/Makefile.am (kill_LDADD): Add $(LIBTHREAD) so that we link with the appropriate libraries to provide Thread Local Storage on platforms that replace strsignal (like AIX for example). Tested-by: Daniel Richard G. <danielg@teragram.com>
2010-04-13cp: treat selinux warnings consistentlyPádraig Brady
* src/copy.c (copy_reg): Suppress SELinux ENOTSUP warnings consistently between the destination being present or not. Previously we did not suppress ENOTSUP messages when the destination was present. (copy_internal): Use the same ENOTSUP supression method as copy_reg() even though the issue was not seen in this case. * tests/cp/cp-a-selinux: Add a test case for the issue and group the other test cases in the file more coherently. * tests/cp/cp-mv-enotsup-xattr: Do the same check for xattr warnings, even though they did not have the issue.
2010-04-12doc: clarify when cp and mv output xattr warningsPádraig Brady
The 2010-03-26 commit, 4c38625e, "doc: fix info on cp --preserve..." was not entirely correct as cp --preserve=all does produce some xattr warnings. * src/copy.h: Update and clarify the comments for reduce_diagnostics and require_preserve_{xattr,context}. * doc/coreutils.texi (cp invocation): Update the -a and --preserve=xattr,context options to say when and which xattr warnings are output. (mv invocation): Mention that some warnings are output when preserving xattrs.
2010-04-09dircolors: add rxvt-256color and rxvt-unicode256Mike Frysinger
* src/dircolors.hin: Add them.
2010-04-09maint: ftruncate is always available, even without gnulibJim Meyering
Now that even MinGW provides ftruncate, we know that all reasonable portability targets provide this function. Remove the workaround code. We nearly removed the gnulib module three years ago: http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/9203 and it is now officially "obsolete". * bootstrap.conf (gnulib_modules): Remove ftruncate. * src/copy.c (copy_reg): Remove use of HAVE_FTRUNCATE and its no-longer-used workaround code. * src/truncate.c: Remove a comment about handling missing ftruncate.
2010-04-08doc: make wc --help say how it defines a 'word'James Youngman
* src/wc.c (usage): Add wc's definition of "word".
2010-04-04tail: include sys/vfs.h (if possible) when sys/statfs.h is absentMarc Kleine-Budde
* src/tail.c [HAVE_INOTIFY && !HAVE_SYS_STATFS_H]: Include <sys/vfs.h>.
2010-03-29build: update after change in gnulib's lib-ignore moduleBruno Haible
* src/Makefile.am (AM_LDFLAGS): Define. Use gnulib's new $(IGNORE_UNUSED_LIBRARIES_CFLAGS).
2010-03-26nice,chroot: use more standard option parsingPádraig Brady
Related to the 2010-03-25 commit, 88d4b346, "timeout: use more standard option parsing". * src/nice.c (main): Don't use parse_long_options() which is a helper for commands that don't have any long options specific to them. * src/chroot.c (main): Likewise. * tests/misc/nice-fail: Remove a case that now passes due to us accepting multiple instances of the --help and --version options. * tests/misc/chroot-fail: Likewise.
2010-03-26timeout: use more standard option parsingKim Hansen
* src/timeout.c (main): Don't use parse_long_options() which is a helper for commands that don't have any long options specific to them. * tests/misc/timeout-parameters: Remove a case that now passes due to us accepting multiple instances of the --help and --version options. * THANKS: Add the author. Signed-off-by: Pádraig Brady <P@draigBrady.com>
2010-03-20maint: code formatting nitJim Meyering
* src/system.h (ST_NBLOCKS): Add space before paren.
2010-03-18rm: tweak wording about loss of data warningEric Blake
* src/rm.c (usage): Update wording to make two points more apparent: undelete is not trivial, and partial recovery should be a consideration factor in deciding whether rm is secure enough. Initially suggested by Reuben Thomas.
2010-03-18revert "maint: mark makefile "dist-hook" target as PHONY"Ralf Wildenhues
* src/Makefile.am (dist-hook): Do not mark this target as PHONY, explicitly. Automake does it for us.
2010-03-18doc: improve ls --help's description of --escape (-b)Eric Blake
* src/ls.c (usage): Be more precise about how --escape (-b) works: say "C-style escapes", not "octal escapes". Reported by Jacky Fong.
2010-03-18maint: mark makefile "dist-hook" target as PHONYJim Meyering
* src/Makefile.am (dist-hook): Mark target as PHONY.
2010-03-17maint: add a space before open-paren, where lackingJim Meyering
* src/copy.c (copy_reg): Likewise. * src/cut.c (main): Likewise. * src/dd.c (main): Likewise. * src/getlimits.c (print_int): Likewise. * src/join.c (join): Likewise. * src/pwd.c (logical_getcwd): Likewise. * src/sort.c (specify_nmerge, mergefps, avoid_trashing_input): Likewise. (merge): Likewise. * src/uptime.c (usage): Likewise.
2010-03-16timeout: add the --kill-after optionPádraig Brady
Based on a report from Kim Hansen who wanted to send a KILL signal to the monitored command when `timeout` itself received a termination signal. Rather than changing such a signal into a KILL, we provide the more general mechanism of sending the KILL after the specified grace period. * src/timeout.c (cleanup): If a non zero kill delay is specified, (re)set the alarm to that delay, after which a KILL signal will be sent to the process group. (usage): Mention the new option. Separate the description of DURATION since it's now specified in 2 places. Clarify that the duration is an integer. (parse_duration): A new function refactored from main(), since this logic is now called for two parameters. (main): Parse the -k option. * doc/coreutils.texi (timeout invocation): Describe the new --kill-after option and use @display rather than @table to show the duration suffixes. Clarify that a duration of 0 disables the associated timeout. * tests/misc/timeout-parameters: Check invalid --kill-after. * tests/misc/timeout: Check a valid --kill-after works. * NEWS: Mention the new feature.
2010-03-10remove: without -f, avoid unnecessary-expense/issues with euidaccessJim Meyering
* src/remove.c (write_protected_non_symlink): If faccessat fails, return 1 or -1 directly, rather than falling back on euidaccess*.
2010-03-04maint: rename the si_present variable in sort to iec_presentPádraig Brady
* src/sort.c: The units containing 'i' are actually IEC not SI.
2010-03-04sort: inform the system about our input access patternJoey Degges
Tell the system that we'll access input sequentially, so that we more efficiently process uncached files in a few cases: Reading from faster flash devices. E.g. 21 MB/s key: NORMAL 31.6s (26.8 user) SEQUENTIAL 27.7s WILLNEED 27.7s Processing in parallel with readahead when using a small 1M buffer: NORMAL 24.7s (21.1 user) SEQUENTIAL 22.7s WILLNEED 25.6s A small benefit when merging: NORMAL 25.0s (16.9 user) SEQUENTIAL 24.6s (16.6 user) WILLNEED 38.4s (13.1 user) Note WILLNEED is presented above for comparison to show it has some unwanted characteristics due to its synchronous prepopulation of the cache. It has a good benefit on a mechanical disk @ 80MB/s and a multicore system with competing processes: NORMAL 14.73s SEQUENTIAL 10.95s WILLNEED 05.22s However the scheduling differences causing this result are probably best explicitly managed using `nice` etc. * m4/jm-macros.m4 (coreutils_MACROS): check for posix_fadvise(). * src/sort.c (fadvise_input): A new function to apply the POSIX_FADV_SEQUENTIAL hint to an input stream. (stream_open): Call the above function for all input streams.
2010-03-01sort: fix issues with month sorting in some localesPádraig Brady
* src/sort.c (char fold_toupper[]): Change to unsigned so as the correct comparisons are made in getmonth(). This fixes unibyte locales where abbreviated months have characters that are > 0x7F, but it also works for multibyte locales with the caveat that multibyte characters are matched case sensitively. With this change, the following example sorts correctly: $ echo -e "1 márta\n2 Feabhra" | LANG=ga_IE.utf8 sort -k2,2M 2 Feabhra 1 márta * src/sort.c (inittables): Since we ignore blanks around months in the input, don't include them when they're present in the locale. With this change, the following example sorts correctly: $ echo -e "1 2月\n2 1月" | LANG=ja_JP.utf8 sort -k2,2M 2 1月 1 2月 * tests/misc/sort-month: A new test to exercise the above cases. * tests/Makefile.am: Reference the new test. * NEWS: Mention the fix.
2010-02-25expr: clarify error messageEric Blake
* src/expr.c (eval4, eval3): Clarify that expr expects integers, and not the broader category of numbers. * tests/misc/expr: Update test accordingly. Suggested by Dan Jacobson.
2010-02-19maint: clean up the output from syntax-check rulesPádraig Brady
* cfg.mk (sc_tight_scope): Pass the -s (silent) flag to `make` so that it doesn't report about calling sub makes. (sc_check-AUTHORS): Likewise. (sc_strftime_check): Don't display stderr from `info`. * src/Makefile.am (sc_tight_scope): Don't annotate with "GEN". (sc_check-AUTHORS): Likewise.
2010-02-17ls: fix a regression by honoring NORMAL attributes againMoritz Orbach
Output the NORMAL attribute before non file name text. This attribute will continue into file names that would not otherwise be colored unless FILE is also set. The regression was introduced with commit 483297d5, 28-02-2009, "ls --color no longer outputs unnecessary escape sequences". * src/ls.c (set_normal_color): A new function to output the NORMAL attribute sequence if it's enabled. (print_current_files): Output NORMAL before printing long format info. (print_file_name_and_frills): Output NORMAL before printing file name. (print_color_indicator): Reset the attributes before a file name with attributes so that NORMAL attributes will not combine with them. (print_name_with_quoting): Ensure attributes are reset after printing the file name if NORMAL attributes were output. * tests/ls/color-norm: A new test for NORMAL and FILE combinations. * tests/Makefile.am: Reference the new test. * NEWS: Mention the fix. Reported in https://savannah.gnu.org/bugs/?26512
2010-02-16maint: fix the man page correlation testsPádraig Brady
These checks were not being run as distcheck-hook targets are only supported in the top-level Makefile. Instead these tests are now run during a syntax-check. * cfg.mk (sc_man_file_correlation): A new syntax check to call the 2 existing tests to check the correlation between the programs and man/*.[1x]. * man/Makefile.am (sc_man_file_correlation): Call the 2 existing man page correlation tests. (check-x-vs-1): Remove the "GEN" annotation as it's a bit verbose. (check-programs-vs-x): Likewise. * src/Makefile.am (all_programs.list): Exclude libstdbuf.so from the list of programs. This issue was not noticed as the checks were not actually being run.
2010-02-15doc: fix inconsistent capitalization in --help outputPádraig Brady
* src/base64.c (usage): Don't capitalize the first character in an --option description. * src/stdbuf.c (usage): Likewise. * src/truncate.c (usage): Likewise. * cfg.mk (sc_option_desc_uppercase): A new syntax check to stop this happening in future. * man/Makefile.am (sc_option_desc_uppercase): Ensure all man pages are generated, then search for erroneous uppercase chars. * src/Makefile.am (all_programs): Ensure all commands are built so that all man pages can be generated.
2010-02-15remove.c: remove three unnecessary #include directivesJim Meyering
* src/remove.c: Don't include hash.h, hash-pjw.h or obstack.h. They have been unused since the fts rewrite.
2010-02-11doc: remove extraneous periods from --help outputPádraig Brady
* src/join.c (usage): Mention "fields" rather than repeating "line" so that it's more obvious that the fields are still parsed, and thus -o is still honored for headers. Also remove an extraneous '.' reported by Stéphane Raimbault. * src/base64.c (usage): Remove extraneous blank line and order the options alphabetically. Also remove an extraneous '.' * src/chown.c (usage): Remove extraneous '.' * src/cp.c (usage): Likewise. * src/mktemp.c (usage): Likewise. * src/pr.c (usage): Likewise. * src/stat.c (usage): Likewise. * src/uniq.c (usage): Likewise.
2010-02-07copy.c: improve a commentJim Meyering
* src/copy.c (copy_reg): The comment about POSIXLY_CORRECT refers only to cp, not to any other application that uses copy.c.
2010-02-01join: make -t '' operate on the whole linePádraig Brady
Previously passing an empty parameter to -t would raise an error, but now it means to treat each line as a single field for matching. This matches the default operation of `sort` which is usually used in conjunction with join. * src/join.c (main): Set the field delimiter to '\n' if an empty parameter is passed to -t. (usage): Mention the operation of -t ''. * tests/misc/join: Add 2 new tests, for the existing -t '\0' and the new -t '' functionality. * doc/coreutils.texi (join invocation): Mention that join -t '' always operates on the whole line, while join -t '\0' usually does. * NEWS: Mention the change in behavior.
2010-02-01join: add --header option to always output the first lineAssaf Gordon
This essentially allows one to use --check-order with headings. Note join without --check-order will already handle the common case where headings do match in each file, however using --check-order will fail often when the header sorts after the first line of data. Note also that this will join header lines from each file even if they don't match, with headings from the first file being used. * NEWS: Mention the new option. * doc/coreutils.texi (join invocation): Describe the new option. * src/join.c (usage): Likewise. (join): Join the header lines unconditionally. * tests/misc/join: Add 5 new tests.
2010-02-01maint: fix an inconsequential memory leak in joinPádraig Brady
* src/join.c (join): Refactor the code that checks for misorder at the tail of the files. The most significant change here is that freeline() is called thus silencing a valgrind warning about a definite but inconsequential memory leak. (freeline): Make more general by doing nothing when passed NULL, and setting freed pointers to NULL.
2010-02-01ls --color: don't emit a final no-op escape sequenceJim Meyering
* src/ls.c (main): With --color, avoid emitting the final color- resetting escape sequence when it would be a no-op. * tests/ls/color-clear-to-eol: Adjust expected output accordingly. * tests/ls/color-dtype-dir: Likewise. * tests/ls/multihardlink: Likewise. * tests/ls/stat-free-symlinks: Likewise. * tests/misc/ls-misc: Likewise. * NEWS (Changes in behavior): Mention it. C de-Avillez rebased and adapted four of the new sl-dangle* tests in tests/misc/ls-misc. Reported by Jim Avera in http://bugs.launchpad.net/ubuntu/+source/coreutils/+bug/494663
2010-01-25who --mesg (-T) can use a more accurate test for TTY writabilityKamil Dudka
Enabled when coreutils is configured with --with-tty-group. Based on a patch written by Piotr Gackiewicz. Details at http://bugzilla.redhat.com/454261 * src/who.c (is_tty_writable): A new function returning true if a TTY device is writable by the group. Additionally it checks the group to be the same as TTY_GROUP_NAME when compiled with --with-tty-group. * m4/jm-macros.m4: Introduce a new configure option --with-tty-group. * NEWS: Mention the change.
2010-01-18libstdbuf: plug a very unlikely leakJim Meyering
* src/libstdbuf.c (apply_mode): Don't leak "buf" upon setvbuf failure.
2010-01-18pr: avoid two over-allocationsJim Meyering
* src/pr.c (init_store_cols): Allocate N*sizeof(*VAR) bytes, not N*sizeof(int*). The latter would mistakenly allocate double the required space on a system with 8-byte pointers.
2010-01-12ls: reorder includes to work around broken <sys/capability.h>Kamil Dudka
* src/ls.c: Include <sys/capability.h> later, to avoid build failure with a header from libcap-2.16-1 or earlier. See http://bugzilla.redhat.com/483548 for details.
2010-01-06pr: ensure the page header line is of the required formatEric Blake
Before this change, with too long a file name, the name would abut the date field on the left and possibly also the "Page N" field on the right, rather than leaving a one-space separator in each case. Fixes a regression introduced on Mar 6 2009, by commit a4053c5291d5797734b3e4f042f9e1adf3944fd6 * src/pr.c (print_header): Ensure that there is at least one space before and after the file name part of the header line. * NEWS: Mention it. * tests/pr/W20l24f-ll: s/xPage/ x Page/. * THANKS: Update. Reported by Denis McKeon, in https://savannah.gnu.org/bugs/?28492.
2010-01-05maint: always free a buffer, to avoid even semblance of a leakJim Meyering
* src/tac.c (main): Free the input buffer in most cases.
2010-01-04maint: use more readable operator: "||" rather than "|"Jim Meyering
* src/cp.c (make_dir_parents_private): Use "||" rather than "|", so that clang understands there is no undefined pointer dereference.
2010-01-01ls: fix color of broken symlinks colored as targetEric Blake
* src/ls.c (print_color_indicator): When using 'LINK target' in dircolors, treat broken symlink as C_ORPHAN. * tests/misc/ls-misc (sl-dangle2, sl-dangle3, sl-dangle4) (sl-dangle5): Test for it, and add more coverage. * NEWS: Document it. * THANKS: Update. Reported by Chris Jones.