summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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-13tests: avoid a false failure on HPUX systemsPádraig Brady
* tests/dd/nocache: Relax the test, as the system may return various errors from posix_fadvise(). HPUX 11.31 returns ENOTTY for example. Reported by Bruno Haible
2011-06-11tests: inotify-rotate: avoid false positive under heavy loadJim Meyering
* tests/tail-2/inotify-rotate: Increase timeout from 10s to 40s to avoid load-induced false positive.
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.
2011-06-01tests: stat-free-color: accommodate stat of /selinux on rawhideJim Meyering
* tests/ls/stat-free-color: This test recently began to fail on rawhide because dynamic library start-up code now stats "/selinux", making the total number of calls 2 rather than the prior 1. Create two more dangling symlinks, so that any erroneous stat- or lstat-calling code will get at least those three.
2011-06-01yes.c: do not use exit after errorMarek Polacek
I think it would be better to exit through the error() and not to call the exit() after the error(). This way we can get rid of one function call (and curly brackets). * src/yes.c (main): Exit through the error(), remove exit() call after error().
2011-06-01tail: fix an inconsequential bug spotted by coverityJim Meyering
* src/tail.c (start_bytes): Increase *READ_POS (not READ_POS) by the number of bytes read. This is a real bug that happens to have no consequence in practice. First, this code is exercised only when tailing-forever a non-regular file by bytes, and with a start-relative offset, e.g., "mkfifo f; tail -f -c +3 f", but even then, the invalid READ_POS value does not influence how tail works. It is stored in the File_spec.size member, but that member is not used at all in tail_forever_inotify, and in tail_forever, it is used only when the File_spec refers to a regular file.
2011-05-31* doc/coreutils.texi (sort invocation): I/0 -> I/O (sr#107504)Paul Eggert
2011-05-29maint: remove unnecessary gnulib .diff fileJim Meyering
* gl/modules/getloadavg.diff: Remove file. It stopped being useful back in February. * Makefile.am (EXTRA_DIST): Remove it.
2011-05-29maint: placate -Wsign-compare when it's non-invasiveJim Meyering
* src/stdbuf.c: Declare loop index to be unsigned.
2011-05-28ls: placate gcc-4.7.0's -Wstrict-overflowJim Meyering
* src/ls.c (enum parse_state): Define. (parse_ls_color): Use enum names in place of constants, thus avoiding the offending -1.
2011-05-28maint: remove useless (off_t) cast of lseek argJim Meyering
* src/wc.c (wc): Remove unnecessary cast. * src/head.c (elide_tail_bytes_file, elide_tail_lines_file): Likewise. * src/tac.c (tac_seekable, tac_file): Likewise.
2011-05-28tests: move tests/misc/split-* into tests/split/...Jim Meyering
* tests/split/suffix-length: Rename from tests/misc/split-a. * tests/split/b-chunk: Rename from misc/split-bchunk. * tests/split/fail: Rename from tests/misc/split-fail. * tests/split/lines: Rename from tests/misc/split-l. * tests/split/l-chunk: Rename from tests/misc/split-lchunk. * tests/split/r-chunk: Rename from tests/misc/split-rchunk. * tests/Makefile.am (TESTS): Reflect renaming.
2011-05-27chown,chgrp: output the original ownership in -v messagesPádraig Brady
* src/chown-core.c (describe_change): Output the original owner if possible. (user_group_str): Handle the case when neither owner or group are passed. * NEWS: Mention the change in behavior.
2011-05-27chown,chgrp: output the correct ownership in -v messagesPádraig Brady
* src/chown_core.c (describe_change): Accept the ownership of the original file and output that when not changing. This is significant when --from is specified as then the original and specified ownership may be different. (user_group_str): A new helper function refactored from describe_change(). (change_file_owner): Pass the original user and group strings to describe_change(). * test/chown/basic: Add a test case. * NEWS: Mention the fix.
2011-05-27maint: fix a -Wstrict-overflow build failure with gcc 4.5Pádraig Brady
* src/ls.c (print_color_indicator): Avoid the warning by not decrementing the integer.
2011-05-26build: --enable-gcc-warnings: enable -Wstrict-overflow in src/Jim Meyering
* configure.ac (WARN_CFLAGS): Don't turn off -Wstrict-overflow. (GNULIB_WARN_CFLAGS): Remove -Wstrict-overflow from the list of warning options used in lib/. Normally I find that -Wstrict-overflow produces too many false positives, but considering that it warns of the bug reported in http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33498, I now think it is worthwhile. The lesser of two evils. Thanks to Daniel Veillard for showing me the gcc bug report.
2011-05-26maint: accommodate gcc's -Wstrict-overflow optionJim Meyering
* src/factor.c (factor_using_pollard_rho): Change type of "i" to unsigned to avoid warning from gcc's -Wstrict-overflow. * src/expr.c: Use an unsigned intermediate. * src/dircolors.c (main): Reorder operations to avoid the risk of pointer overflow. * src/tr.c (squeeze_filter): Change NOT_A_CHAR from an anonymous "enum" to an "int", to avoid this warning: tr.c:1624:10: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow] * src/pr.c (main): Make index "i" unsigned.
2011-05-26maint: enforce cpp indentation policyJim Meyering
* cfg.mk (sc_preprocessor_indentation): New test, from libvirt. Exempt 3 files from new cppi test. * gl/lib/randread.c: Adjust cpp indentation to comply. * src/extent-scan.c (extent_need_sync): Likewise.
2011-05-26maint: env.c: remove unnecessary use of strchrJim Meyering
* src/env.c (main): Remove excess (and confusing to static analyzers) use of strchr.
2011-05-26shred: placate coverity and fix a commentJim Meyering
* src/shred.c (incname): Add an assertion to tell static analyzers that we know this particular use of strchr never returns NULL. Finish incomplete sentence in function-describing comment.
2011-05-26maint: split: remove --filter specific code from other pathsPádraig Brady
* src/split.c (lines_chunk_split): Don't use ignore_error() which is redundant and confusing when not running with --filter. (lines_rr): Likewise. (ofile_open): Likewise. Add a comment to clarify that filters aren't restarted under file descriptor pressure.
2011-05-26split: diagnose when --filter is used with a chunk numberPádraig Brady
* src/split.c (main): Exit with a diagnostic if --filter is specified along with a specific chunk number. * test/split/filter: Ensure this combination fails.
2011-05-26split: exit when we can no longer write to a --filterPádraig Brady
* src/split.c (bytes_split): Stop reading when we can no longer write to a child process. (lines_rr): Likewise. (lines_bytes_split): No change is made here since input is bounded by the original file size. * test/split/filter: Add test cases.
2011-05-26split: return success even if a --filter exitsPádraig Brady
src/split.c (main): Don't unblock SIGPIPE before cleanup, as then any pending signals will be sent and cause the main split process to exit with a non zero status (141). * test/split/filter: Add a test for this case.
2011-05-25split: fix an edge case where -n l/... creates an extra filePádraig Brady
* src/split.c (lines_bytes_chunk): Handle the edge case where the file is truncated as we read. * tests/misc/split-lchunk: Cleanup; no functional change.
2011-05-25chmod: output the original mode in verbose modeBernhard Voelker
* src/chmod.c (describe_change): Pass in the original mode, and output this in the messages. * tests/chmod/c-option: Adjust as per the new message. * THANKS.in: Remove the now auto-generated name. * NEWS: Mention the change in behavior. Signed-off-by: Pádraig Brady <P@draigBrady.com>
2011-05-25tests: ls/stat-free-color: fix unwarranted failure on a 32-bit systemJim Meyering
* tests/ls/stat-free-color: Also check for stat64 and lstat64 syscalls. This fixes a test failure reported by Stefano Lattarini.
2011-05-25maint: accommodate gnulib's newer tight_scope ruleJim Meyering
* cfg.mk: Include via "-include", to accommodate new tight-scope rule. (sc_check-AUTHORS): Change the name of the rule in src/Makefile.am to _sc_check-AUTHORS, so it doesn't conflict with this one when this file is included into the sub-make's context. * src/Makefile.am (_sc_check-AUTHORS): Rename from sc_check-AUTHORS. * gnulib: Update to latest.
2011-05-25doc: make README-hacking slightly more genericJim Meyering
* README-hacking: Remove a reference to "coreutils".
2011-05-25touch: placate static analyzers: no NULL-deref is possibleJim Meyering
* src/touch.c (main): Avoid even the hint of possibility that we'd dereference NULL upon localtime failure. Coverity reported the potential, but it appears not to be possible, since posixtime rejects any time for which the subsequent localtime would return NULL. See http://thread.gmane.org/gmane.comp.gnu.coreutils.general/1253
2011-05-24split: fix cases where -n l/... creates extraneous filesPádraig Brady
* src/split.c (lines_chunk_split): Ensure that data is only written to stdout when k specified. Also ensure that extra files are not created when there is more data available than reported in the file size. * tests/misc/split-lchunk: Verify that split -n l/k/n doesn't generate any files, and that -n l/n always generates n files. * NEWS: Mention the fix.
2011-05-24doc: add a missing space in timeout --helpStéphane Raimbault
* src/timeout.c (usage): Add a space to be consistent with other uses of "(the default)" in the documentation. Signed-off-by: Pádraig Brady <P@draigBrady.com>
2011-05-24doc: improve tail -f vs. inotify description and advicePádraig Brady
* doc/coreutils.texi (tail invocation): Adjust, and add an example.
2011-05-23maint: avoid trivial syntax-check failureJim Meyering
* doc/coreutils.texi (tail invocation): Use @var{n}, not @var{N}.
2011-05-23maint: README-hacking clarificationsKarl Berry
* README-hacking: Small getting-started clarifications.
2011-05-23doc: describe how kernel inotify support affects tail -fJim Meyering
* doc/coreutils.texi (tail invocation) [-f]: Mention how inotify kernel support makes a difference. Prompted by http://bugzilla.redhat.com/662900
2011-05-22tests: fix typo in tac-continueJim Meyering
* tests/misc/tac-continue: Fix typo in usually-skipped test: s/mkfifo_or_skip/mkfifo_or_skip_/ (i.e., append "_"). This test is usually skipped, because I'm probably the only one to set the FULL_PARTITION_TMPDIR envvar, and recently the one I'd been using ceased to exist, so this test was skipped even for me. Good argument for making this a root-only test and creating a full partition just for this test case.
2011-05-22doc: fix a formatting nit in od's texinfo documentationJim Meyering
* doc/coreutils.texi (od invocation): Typesetting of "bytes" was wrong. Fix it via s/@code/@var/ so it's consistent.
2011-05-21maint: fix comment typos in df.cIvan Sichmann Freitas
* src/df.c: s/Optain/Obtain/
2011-05-19maint: correct typos involving misuse of "a" and "an"Jim Meyering
* NEWS: "an misleading" * src/expr.c: "a integer * src/ptx.c (find_occurs_in_text): "a end" * src/shred.c (do_wipefd): "a infinite" * src/sort.c (SUBTHREAD_LINES_HEURISTIC): "an dual-core" (compare_random): "an checksum" * cfg.mk (old_NEWS_hash): Update, since the typo was in old news.
2011-05-18printf: fix an out-of-bounds memory accessPádraig Brady
* src/printf.c (STRTOX): Don't access memory after a string containing a single quote character. * tests/misc/printf: Add tests for various combinations of single quote characters combined with a numeric format. * THANKS.in: Add bug reporter. * NEWS: Mention the fix. Reported-by: Paul Marinescu <paul.marinescu@imperial.ac.uk>
2011-05-17doc: mention that ls time ordering is newest firstPádraig Brady
* src/ls.c (usage): Add the "newest first" info to the -t and -c options
2011-05-14tests: refactor more tests to use mkfifo_or_skip_Pádraig Brady
* tests/cp/existing-perm-race: s/mkfifo/mkfifo_or_skip_/ * tests/cp/file-perm-race: Likewise. * tests/cp/parent-perm-race: Likewise. * tests/cp/special-f: Likewise. * tests/dd/reblock: Likewise. * tests/ls/file-type: Likewise. * tests/misc/cat-buf: Likewise. * tests/misc/mknod: Likewise. * tests/misc/printf-surprise: Likewise. * tests/misc/selinux: Likewise. * tests/misc/sort-spinlock-abuse: Likewise. * tests/misc/stdbuf: Likewise. * tests/misc/tac-continue: Likewise. * tests/init.cfg: Improve the error message when skipping.
2011-05-14shuf: use memory more efficiently when returning a subsetPádraig Brady
* gl/lib/randperm.c (randperm_new): When the number of items to return H, is much smaller than the total number of items N, use a hash to represent the sparse permutations of the set N. This is currently enabled for N > 128K and N/H > 32. * tests/misc/shuf: Ensure shuf can quickly return 2 numbers from a large range. * gl/modules/randperm: Depend on hash. * NEWS: Mention the change.
2011-05-13maint: avoid syntax-check failure due to long lineJim Meyering
* tests/du/bigtime (future_time): Split long line.
2011-05-13maint: add new syntax-check rule to prohibit use of skip_Jim Meyering
* cfg.mk (sc_prohibit_skip_): New rule. * tests/init.cfg (skip_test_): Add a comment.