summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2011-09-08stat: avoid compilation failure on AIX 7.xJim Meyering
* src/stat.c (USE_STATVFS): Adjust definition so that it is enabled also on AIX 7.x systems that provide statvfs64 and no statvfs. [USE_STATVFS && ! STAT_STATVFS && STAT_STATVFS64] (STATFS): Define to statvfs64 in that precise case. * m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Adjust the condition here to match the new one in stat.c, to keep them in sync. Reported by Bruno Haible. For details, see http://article.gmane.org/gmane.comp.gnu.coreutils.general/1668
2011-09-01timeout: fixup previous warning fixPádraig Brady
* src/timeout.c (settimeout): Fix the previous commit to test errno rather than the return value.
2011-09-01timeout: suppress a redundant warning on some systemsPádraig Brady
* src/timeout.c (settimeout): Don't warn about ENOSYS which is returned on OpenBSD 4.9 at least. Reported by Bruno Haible
2011-09-01stdbuf: fix helper lib identification on some platformsPádraig Brady
* src/stdbuf.c (main): Pass the path of `stdbuf` rather than the command it's running to the search function. This is significant on platforms without /proc/self/exe Reported by Bruno Haible
2011-09-01build: avoid the use of strsignal() in splitPádraig Brady
... which is not available on some platforms, and the replacement currently requires linking with threading libraries. * src/split.c (closeout): Remove the call to strsignal() which is largely redundant anyway as sig2str() is already used to map number to name in the error. Reported by Bruno Haible on AIX 6.1 and 7.1
2011-08-25timeout: revert signal propagation enhancementPádraig Brady
This effectively reverts the unreleased commit 5a647a05 * src/timeout.c (main): Don't propagate signals from the monitored process, as on Linux /proc/sys/kernel/core_pattern could still handle them and cause false reports against `timeout`
2011-08-24pr: fix so that LAST_PAGE is honored with -TPádraig Brady
Ever since the LAST_PAGE functionality was added in commit ed0923a1, 1996-12-05, "Apply big patch (patch-20) from Roland Huebner" it was ignored when -t or -T were specified or when -l <= 10. * src/pr.c (print_page): Increment the current page here. (print_header): Don't increment the current page here. * tests/pr/pr-tests: Add a test case. * NEWS: Mention the fix Reported at http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9347
2011-08-13maint: remove empty statement after jump labelBernhard Voelker
* src/head.c (elide_tail_bytes_pipe): Remove the empty statement, ";" after a jump label; it is needed only when a declaration follows. * src/kill.c (main): Likewise. * src/od.c (main): Likewise. * src/paste.c (collapse_escapes): Likewise. * src/printf.c (print_formatted): Likewise.
2011-08-12pathchk: port to hosts where mbstate_t is replacedPaul Eggert
This problem was discovered when trying to build git coreutils on Solaris 8 sparcv9 with Sun C 5.8: the 3rd argument to mbrlen was of type int * (a pointer to the gnulib replacement mbstate_t) but the system mbrlen wants the system mbstate_t *. * bootstrap.conf (gnulib_modules): Add mbrlen. * src/pathchk.c (mbrlen, mbstate_t) [!(HAVE_MBRLEN && HAVE_MBSTATE_T)]: Remove macros, which are wrong now that gnulib supplies replacements for mbstate_t and mbrlen.
2011-08-08join: with --check-order print offending file name, line number and dataJim Meyering
* src/join (g_names): New global (was main's "names"). (main): Update all uses of "names". (line_no[2]): New globals. (get_line): Increment after reading each line. (check_order): Print the standard "file name:line_no: " prefix as well as the offending line when reporting disorder. Here is a sample old/new comparison: -join: file 1 is not in sorted order +join: in:4: is not sorted: contents-of-line-4 * tests/misc/join: Change the two affected tests to expect the new diagnostic. Add new tests for more coverage: mismatch in file 2, two diagnostics, zero-length out-of-order line. * NEWS (Improvements): Mention it. Suggested by David Gast in http://debbugs.gnu.org/9236
2011-08-08maint: use xcalloc rather than xmalloc+memset (no semantic change)Jim Meyering
* src/join.c (init_linep): Use xcalloc, not xmalloc+memset.
2011-07-27maint: copy: refactor hard link creationPádraig Brady
* src/copy.c (create_hard_link): A new function refactored from existing code. (copy_internal): Call the new function from all 3 locations that create hard links. * tests/cp/same-file: Amend to match the adjusted diagnostic.
2011-07-26maint: use consistent style in C and test scriptsJim Meyering
* src/copy.c (copy_internal): Adjust formatting style to conform with guidelines in HACKING: put braces around two one-line "else" blocks. * tests/cp/existing-perm-dir: Use $(...), not `...`, and stat rather than ls+cut to get the mode string. mode=$(stat --p=%A dst/dir)
2011-07-25cp: don't mishandle existing dir dest permissions (Bug#9170)Paul Eggert
* src/copy.c (copy_internal): If we don't create the directory, then we cannot have omitted permissions. Problem and trivial fix reported by Eric Lammerts. * tests/Makefile.am (TESTS): Add cp/existing-perm-dir. * tests/cp/existing-perm-dir: New file.
2011-07-25cp -up: preserve all hard linksJim Meyering
* src/copy.c (copy_internal): With --update (-u), this function would return early once it found that the destination is not older than the source, *without* recording the source-dev/ino--to--dest_name mapping. That mapping is required in order to preserve src hard links in the destination tree, so when using cp with --update and --preserve=links (perhaps via -p or -a), cp could fail to preserve one hard link per inode when at least one of the hard-linked names already exists in the destination tree. Reported by Odd Harry Mannsverk in http://debbugs.gnu.org/8419. * tests/cp/preserve-link: New file. Exercise the flaw/fix. * tests/Makefile.am (TESTS): Add it. * NEWS (Bug fixes): Mention it.
2011-07-25timeout: support sub-second timeoutsPádraig Brady
* src/timeout.c (settimeout): A new function to convert from a floating point duration and call alarm() or timer_settime() if that's available. (parse_duration): Return a double rather than unsigned int. (usage): Mention floating point is supported. (main): Pass the double to settimeout() rather than calling alarm() directly with the parsed int. (cleanup): Likewise. * doc/coreutils.texi (timeout invocation): Say floating point timeouts now supported, and mention the caveat with resolution. * bootstrap.conf: Include the timer-time gnulib module. * tests/misc/timeout-parameters: Add a test with nanoseconds. * NEWS: Mention the improvement.
2011-07-20dircolors: add screen.Eterm terminal typeMike Frysinger
* src/dircolors.hin: Add screen.Eterm. Reported by Kfir Lavi
2011-07-20unexpand: fix misalignment when spaces span a tabstopPádraig Brady
The following dropped the space from the first field printf "1234567 \t1\n" | unexpand -a Note POSIX says that spaces should not precede tabs. Also a single trailing space should not be converted if the next field starts with non blank characters. So we enforce those rules too, with this change. * src/unexpand.c (unexpand): Implement as per POSIX rules. * tests/misc/unexpand: Add tests, and adjust existing tests as per POSIX rules. * NEWS: Mention the fix. Reported by Hallvard B Furuseth
2011-07-16timeout: treat seconds counts like 'sleep' doesPaul Eggert
Treat fractions as a request to round up to the next representable value, and treat out-of-range values as maximal ones. This is consistent with how "sleep" works. And this way, "timeout 999999999999999999d FOO" and "timeout 4.5 foo" are more likely to do what the user wants. * src/timeout.c: Include c-strtod.h and xstrtod.h, not xstrtol.h. (apply_time_suffix): Change it to the way sleep.c's time_suffix does things. Maybe this function (identical in both programs, other than its name) should be moved to a library? (parse_duration): Return a maximal value on overflow. Return unsigned int, not unsigned long. Allow fractions, which round up to the next integer value. * tests/misc/timeout-parameters: Adjust tests to match new behavior. Add a very large number.
2011-07-16Fix capiTalization in comments.Paul Eggert
2011-07-16* src/timeout.c (main): Use waitpid, not wait (Bug#9098).Paul Eggert
Reported by Andreas Schwab. * src/timeout.c (SA_RESTART): Define to 0 if not defined.
2011-07-16timeout: port to NonStop (Bug#9077)Paul Eggert
* src/timeout.c (SA_RESTART): Define to 0 if not defined. (main): Don't assume signal handling uses SA_RESTART.
2011-07-16ls: port to NonStop (Bug#9076)Paul Eggert
* src/ls.c (SA_RESTART): Define to 0 if not defined.
2011-07-16dd: port to NonStop (Bug#9076)Paul Eggert
* src/dd.c (SA_RESETHAND): Define to 0 if not defined.
2011-07-15csplit: don't prematurely terminate cleanup (Bug#9076)Paul Eggert
* src/csplit.c (interrupt_handler): Reset signal to SIG_DFL after deleting the files, so that a second interrupt won't prematurely terminate cleanup. (main): Don't use SA_NODEFER | SA_RESETHAND, as that might allow premature termination of cleanup. Also, this ports better to platforms like NonStop, which don't ahve SA_RESETHAND.
2011-07-15* src/dd.c: Remove obsolete comments re POSIX.Paul Eggert
2011-07-15build: avoid a st_blksize compile failure on some systemsPádraig Brady
* src/stat.c (print_stat): Use ST_BLKSIZE() rather than accessing st_blksize directly, which is not present on NonStop at least. Reported by Joachim Schmitz.
2011-07-15build: avoid a fiemap compile failure on some systemsPádraig Brady
* src/fiemap.h (struct fiemap): Adjust the previous change to the fiemap_extents array, which would also require changes to the sizeof calculations in extent_scan_read(). Instead, only declare the fiemap_extents zero length array on linux, which is the only platform that references this member. This avoids a compilation failure on systems that don't support this non standard construct. We don't use the equivalent C99 flexible array construct so as to have maximum portability. * src/extent-scan.c: Cleanup. Remove a redundant #ifndef.
2011-07-14* src/fiemap.h (struct fiemap.fm_extents): Change size to 1.Paul Eggert
This is for portability to non-GCC C89 and C99 compilers. Original problem, on NonStop, reported by Joachim Schmitz in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9077>.
2011-07-14maint: fix warning 'possible use of "=" where "==" was intended'Bernhard Voelker
* src/mktemp.c: maint: avoid warning by using the comma operator rather than an always-true conditional (as suggested by Eric Blake). Reported by Joachim Schmitz in http://debbugs.gnu.org/9064.
2011-07-13doc: describe the file permissions set by mktempBenoît Knecht
* src/mktemp.c (usage): As above, for --help. Reported by Jordi Pujol in http://bugs.debian.org/551093. Wording improvments from Eric Blake.
2011-07-13doc: note the order in which wc counts are printedBenoît Knecht
This information has already been added to the Texinfo manual, but was missing from the --help output. * src/wc.c (usage): As above, for --help. Reported by Vincent Lefevre in http://bugs.debian.org/395430.
2011-07-11dircolors: highlight .webm multimedia filesBenoît Knecht
* src/dircolors.hin: Add .webm multimedia files. Suggested by Josh Triplett in http://bugs.debian.org/582403.
2011-07-08timeout: handle signals more transparentlyPádraig Brady
* m4/jm-macros.m4: Define HAVE_SETRLIMIT. * src/timeout.c: If the child exited with a signal, raise that signal to the timeout process itself, so that callers may also see the signal status. Use setrlimit to disable core dumps for the timeout process, which would be generated by some signals.
2011-07-08timeout: support cascaded timeoutsPádraig Brady
* src/timeout.c (cleanup): Send signals directly to the child in case it has started its own process group (like a cascaded timeout command would for example). * test/misc/timeout-group: Add a test case. * NEWS: Mention the fix.
2011-07-08timeout: add --foreground to support interactive commandsPádraig Brady
Or more accurately, commands not started from the shell prompt, that are interactive, or need to receive Ctrl-C etc. from the terminal. * doc/coreutils.texi (timeout invocation): Document --foreground. * src/timeout.c (main): Set the foreground flag and don't create a separate group. (cleanup): Only send a signal directly to the monitored command when the foreground flag is set. (usage): Describe --foreground. * tests/misc/timeout-group: Add a new test. * tests/Makefile.am: Reference new test. NEWS: Mention the new option. Reported by Shay Shimony Analysis by Alan Curry Fix suggested by Paul Eggert
2011-07-08doc: note that cp -l creates _hard_ linksBenoît Knecht
This fact was already noted in the Texinfo manual, but not in the output of --help. * src/cp.c (usage): As above, for --help. Reported by Jari Aalto in http://bugs.debian.org/294327.
2011-07-07md5sum, sha1sum, etc: accept new option: --strictPatrick Schoenfeld
Use this new option with --check when the input is expected to consist solely of checksum lines. With only --check, an invalid line evokes a warning, but the program can still exit successfully. With --strict, any invalid line makes the program exit non-zero. * src/md5sum.c (strict, STRICT_OPTION): Declare/define. (long_options): Add "strict". (usage): Describe --strict. (digest_check): Count improperly_formatted lines, too, and use that number and the global "strict" to determine the return value. (main): Handle STRICT_OPTION. Reject --strict without --check. * doc/coreutils.texi: Describe it. * NEWS (New features): Mention it.
2011-07-07doc: note date's %k, %l are space-padded and equivalent to %_H and %_IBenoît Knecht
* src/date.c (usage): As above, for --help. * doc/coreutils.texi (Time conversion specifiers): Likewise. Reported by Britton Leo Kerin in http://bugs.debian.org/115833.
2011-07-07stat: recognize GPFS as a file system typeJim Meyering
* src/stat.c (human_fstype) [S_MAGIC_GPFS]: Add a case, to handle GPFS_SUPER_MAGIC/0x47504653. Prompted by this discussion: http://thread.gmane.org/gmane.comp.sysutils.autoconf.general/14007 * NEWS (Improvements): Mention it.
2011-07-02maint: use "const" and "pure" function attributes where possibleJim Meyering
* configure.ac (WARN_CFLAGS): Add -Wsuggest-attribute=const, -Wsuggest-attribute=pure and -Wsuggest-attribute=noreturn. (GNULIB_WARN_CFLAGS): But do not add them here... yet. * src/chown-core.h (chopt_free, uid_to_name): Add function attribute(s). * src/copy.c (is_ancestor, valid_options): Likewise. * src/copy.h (chown_failure_ok): Likewise. * src/dd.c (operand_matches, operand_is): Likewise. * src/df.c (selected_fstype, excluded_fstype): Likewise. * src/expr.c (null looks_like_integer): Likewise. * src/md5sum.c (hex_digits): Likewise. * src/od.c (get_lcm): Likewise. * src/pathchk.c (component_start, component_len): Likewise. * src/pinky.c (count_ampersands): Likewise. * src/pr.c (cols_ready_to_print): Likewise. * src/ptx.c (search_table): Likewise. * src/sort.c (find_unit_order): Likewise. * src/stty.c (mode_type_flag, string_to_baud, baud_to_value): Likewise. * src/system.h (gcd, lcm): Likewise. * src/tr.c (is_char_class_member, look_up_char_class): Likewise. (star_digits_closebracket): Likewise. * src/uniq.c (find_field): Likewise. * src/wc.c (compute_number_width): Likewise. * lib/xfts.h (cycle_warning_required): Likewise. * gl/lib/randint.h (randint_get_source): Likewise. * gl/lib/randperm.c (ceil_lg): Likewise. * gl/lib/randperm.h (randperm_bound): Likewise. * lib/strnumcmp.h (strintcmp): Likewise.
2011-06-25doc: improve ls --help grammarJim Meyering
* src/ls.c (usage): Improve grammar. Reported by Peng Yu.
2011-06-25maint: don't use gnulib's pathmax module; define PATH_MAX if neededJim Meyering
* bootstrap.conf (gnulib_modules): Remove pathmax. * src/system.h: Don't include "pathmax.h". (PATH_MAX) [!PATH_MAX]: Define to 8192. Defining it to a constant is preferable to using a definition from pathmax.h that might expand to pathconf ("/", _PC_PATH_MAX). Prompted by discussion leading to: http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/27183/focus=27269
2011-06-24stat: recognize MQUEUE and PSTOREFS file systemsPádraig Brady
* src/stat.c (human_fstype): Add magic numbers for PSTOREFS and MQUEUE.
2011-06-19stdbuf: fix automake variable name to work with cutting edge automakeJim Meyering
* src/Makefile.am (pkglibexec_PROGRAMS): Rename from pkglib_PROGRAMS. The latter is invalid. Without this change, automake v1.11-373-g9ca6326 and newer (on master) would fail with this: `pkglibdir' is not a legitimate directory for `PROGRAMS' This changes the default installation directory of libstdbuf.so from $prefix/lib/coreutils/ to $prefix/libexec/coreutils/ * src/stdbuf.c (set_LD_PRELOAD): Search in PKGLIBEXECDIR, not PKGLIBDIR, since that's where we install libstdbuf.so. Do not search in "", the system default search path.
2011-06-13maint: use stat-size module from gnulibJames Youngman
* gnulib: Update to latest. * src/system.h: Definitions of ST_* macros have moved into the gnulib module stat-size (specifically, the header file stat-size.h), so remove them from here. * src/truncate.c: Include stat-size.h. * src/stat.c: Likewise. * src/shred.c: Likewise. * src/ls.c: Likewise. * src/du.c: Likewise. * src/ioblksize.h: New file. Move definition of io_blksize out of system.h so that system.h does not have to include stat-size.h. * src/cat.c: Include ioblksize.h. * src/split.c: Likewise. * src/copy.c: Include both stat-size.h and ioblksize.h. * src/Makefile.am (noinst_HEADERS): Add ioblksize.h.
2011-06-09maint: remove unneeded includesPádraig Brady
Remove unneeded includes as reported by: http://code.google.com/p/include-what-you-use/ * src/cp-hash.c: Remove unused include. * src/dd.c: Likewise. * src/du.c: Likewise. * src/head.c: Likewise. * src/kill.c: Likewise. * src/ls.c: Likewise. * src/stdbuf.c: Likewise. * src/timeout.c: Likewise. * src/truncate.c: Likewise.
2011-06-09doc: add examples to date --helpPádraig Brady
* src/date.c (usage): Add examples for TZ handling, and "seconds since epoch" parsing, neither of which was mentioned in the man page until now. * THANKS.in: Add Rick. Suggested by Rick Stanley.
2011-06-04build: require at least 2-year old autoconf-2.64 (was 2.62)Jim Meyering
* configure.ac: Require autoconf-2.64, which is nearly two years old. * src/system.h (emit_ancillary_info): Use PACKAGE_URL, now that we require autoconf-2.64.
2011-06-04maint: remove now-spurious curly bracesJim Meyering
* src/chown-core.c (restricted_chown): Remove FIXME comment and superfluous curly braces.