]> git.ipfire.org Git - thirdparty/coreutils.git/log
thirdparty/coreutils.git
8 years agotests: use "returns_" rather than explicit comparison with "$?"
Jim Meyering [Wed, 9 Nov 2016 01:57:41 +0000 (19:57 -0600)] 
tests: use "returns_" rather than explicit comparison with "$?"

* tests/chmod/no-x.sh: Likewise.
* tests/cp/no-deref-link1.sh: Likewise.
* tests/cp/no-deref-link2.sh: Likewise.
* tests/cp/no-deref-link3.sh: Likewise.
* tests/du/move-dir-while-traversing.sh: Likewise.
* tests/ls/infloop.sh: Likewise.
* tests/ls/stat-failed.sh: Likewise.
* tests/ls/time-style-diag.sh: Likewise.
* tests/misc/chroot-fail.sh: Likewise.
* tests/misc/env-null.sh: Likewise.
* tests/misc/env.sh: Likewise.
* tests/misc/nice-fail.sh: Likewise.
* tests/misc/printenv.sh: Likewise.
* tests/misc/timeout.sh: Likewise.
* tests/tail-2/follow-name.sh: Likewise.

8 years agotail: only retry file open if --retry specifed
Pádraig Brady [Wed, 9 Nov 2016 19:28:23 +0000 (19:28 +0000)] 
tail: only retry file open if --retry specifed

* src/tail.c (tail_file): On failure to open a file,
set ignore=true when --retry is not specified.
* tests/tail-2/assert-2.sh: Adjust to the new behavior.
* tests/tail-2/retry.sh: Add a test case.  Also change
from `tail ... && fail=1` to the more robust `returns_ 1 ...`
construct which detects segfaults etc.
* NEWS: Document the fix.

8 years agotail: ensure -f --retry 'missing' handles truncation
Pádraig Brady [Wed, 9 Nov 2016 17:51:13 +0000 (17:51 +0000)] 
tail: ensure -f --retry 'missing' handles truncation

* src/tail.c (tail_forever): The BLOCKING optimization is only
enabled for non regular files (which can't be truncated), so ensure
we don't enable that unless we've a valid file descriptor.
* tests/tail-2/retry.sh: Add a test case.
* NEWS: Mention the bug fix.

8 years agotail: avoid outputting repeated data with remote files
Pádraig Brady [Wed, 9 Nov 2016 17:23:04 +0000 (17:23 +0000)] 
tail: avoid outputting repeated data with remote files

* src/tail.c (tail_forever): Only read up to st_size on network
file systems to avoid the issue with a stale attribute cache
returning a smaller st_size than we have already read().
The was seen with glusterfs at least and caused the complete
file to be repeatedly output due to assuming the file was
truncated in this case.
* NEWS: Mention the fix.

8 years agotail: terminate when following pipes and untailable non pipes
Pádraig Brady [Tue, 8 Nov 2016 17:34:44 +0000 (17:34 +0000)] 
tail: terminate when following pipes and untailable non pipes

* src/tail.c (ignore_pipe_or_fifo): Mark the descriptor as -1
for pipes so that any_live_files() detects correctly that
the entry is no longer live.
* tests/tail-2/pipe-f.sh: Add a test case.
* NEWS: Mention the fix.
Fixes http://bugs.gnu.org/24903 which was detected
using Symbolic Execution techniques developed in
the course of the SYMBIOSYS research project at
COMSYS, RWTH Aachen University.

8 years agomaint: misc tweaks to recent changes
Pádraig Brady [Sun, 6 Nov 2016 21:34:12 +0000 (21:34 +0000)] 
maint: misc tweaks to recent changes

* doc/coreutils.texi(cut invocation): Give a more accurate description
of cut field handling limitations.
* tests/misc/stat-fmt.sh: Fix the test header to be more general.
* tests/tail-2/retry.sh: Spellings.

8 years agomaint: refactor printing of backup suffix --help
Pádraig Brady [Wed, 2 Nov 2016 23:56:53 +0000 (23:56 +0000)] 
maint: refactor printing of backup suffix --help

* src/system.h (emit_backup_suffix_note): A new function to
output the backup suffix info.  The strings are unchanged,
so translations are not impacted.
* src/cp.c (usage): Use the new function.
* src/ln.c (usage): Likewise.
* src/mv.c (usage): Likewise.
* src/install.c (usage): Likewise.

8 years agomaint: simplify handling of backup --suffix in various tools
Rishabh Dave [Wed, 2 Nov 2016 23:43:47 +0000 (23:43 +0000)] 
maint: simplify handling of backup --suffix in various tools

* src/cp.c (main): Avoid the getenv("SIMPLE_BACKUP_SUFFIX") call,
which is now done if needed in the gnulib backupfile module.
Also avoid the redundant strdup, as we don't modify this suffix.
* src/install.c (main): Likewise.
* src/ln.c (main): Likewise.
* src/mv.c (main): Likewise.
Fixes http://bugs.gnu.org/23153

8 years agodate: add %q to output the quarter of the year
Pádraig Brady [Wed, 19 Oct 2016 21:57:57 +0000 (14:57 -0700)] 
date: add %q to output the quarter of the year

* doc/coreutils.texi (date invocation): Document %q.
* src/date.c (usage): Likewise.
* tests/misc/date.pl: Add a test case.
* cfg.mk (sc_strftime_check): Adjust to allow %q.
* NEWS: Mention the new feature.

8 years agoall: update gnulib submodule to latest
Pádraig Brady [Sat, 5 Nov 2016 17:14:41 +0000 (17:14 +0000)] 
all: update gnulib submodule to latest

Incorporating these coreutils specific changes:
  backupfile: initialize default suffix within the implementation
  strftime,strptime: support %q to represent the quarter

Also sync these copies with gnulib:
* bootstrap: Now supports AIX.
* gnulib: Update to the latest.
* tests/init.sh: dash(1) is now disabled.

8 years agodoc: clarify in texinfo that cut doesn't reorder fields
Pádraig Brady [Sat, 5 Nov 2016 12:16:34 +0000 (12:16 +0000)] 
doc: clarify in texinfo that cut doesn't reorder fields

* doc/coreutils.texi (cut invocation): Clarify the more
sophisticated field processing supported by awk(1).
Fixes http://bugs.gnu.org/24881

8 years agostat: make --format=%N honor the QUOTING_STYLE env var
Pádraig Brady [Thu, 3 Nov 2016 15:36:48 +0000 (15:36 +0000)] 
stat: make --format=%N honor the QUOTING_STYLE env var

* doc/coreutils.texi (stat invocation): Describe the
QUOTING_STYLE values now supported.
* src/stat.c (getenv_quoting_style): A new function called
from main, that sets the default quoting style for quotearg.
(main): Call getenv_quoting_style() when %N specified.
* tests/misc/stat-fmt.sh: Add a test case.
* NEWS: Mention the improvement.
Fixes http://bugs.gnu.org/23422

8 years agodoc: improve the --help description of ls -N
Pádraig Brady [Thu, 3 Nov 2016 19:24:25 +0000 (19:24 +0000)] 
doc: improve the --help description of ls -N

* src/ls.c (usage): The existing description was inaccurate
as -N does not directly impact whether control characters
are displayed or not.

8 years agodd: warn about counts specified with confusing 0x prefix
Pádraig Brady [Fri, 4 Nov 2016 16:55:58 +0000 (16:55 +0000)] 
dd: warn about counts specified with confusing 0x prefix

* src/dd.c (parse_integer): Suggest to use "00x" instead of "0x",
which is significant for the "count", "seek", and "skip" operands.
* tests/dd/misc.sh: Add a test case.
Fixes http://bugs.gnu.org/24874

8 years agomd5sum,sha*sum: fix --ignore-missing with checksums starting with 00
Pádraig Brady [Wed, 26 Oct 2016 14:45:01 +0000 (15:45 +0100)] 
md5sum,sha*sum: fix --ignore-missing with checksums starting with 00

* NEWS: Mention the fix.
* src/md5sum.c (digest_file): Add a new MISSING parameter to
return whether the file was missing, separately from the digest.
* tests/misc/md5sum.pl: Add a test case.
Fixes http://bugs.gnu.org/24795

8 years agodoc: fix typo in stdbuf man page
Bishop Bettini [Sat, 22 Oct 2016 00:31:22 +0000 (17:31 -0700)] 
doc: fix typo in stdbuf man page

* man/stdbuf.x: Correct spelling of immediately.
Fixes http://bugs.gnu.org/24763

8 years agomaint: we use die; remove now-unnecessary uses of abort
Jim Meyering [Sun, 16 Oct 2016 18:28:39 +0000 (11:28 -0700)] 
maint: we use die; remove now-unnecessary uses of abort

* src/expr.c (integer_overflow): Remove an abort-after-die.
* src/paste.c (write_error): Likewise.
* src/sort.c (badfieldspec): Likewise.
* src/tr.c (string2_extend): Likewise. Also remove a few
break statements, each after an abort.

8 years agoall: use die() rather than error(EXIT_FAILURE)
Pádraig Brady [Sat, 15 Oct 2016 22:10:35 +0000 (23:10 +0100)] 
all: use die() rather than error(EXIT_FAILURE)

die() has the advantage of being apparent to the compiler
that it doesn't return, which will avoid warnings in some cases,
and possibly generate better code.
* cfg.mk (sc_die_EXIT_FAILURE): A new syntax check rule to
catch any new uses of error (CONSTANT, ...);

8 years agobuild: also distribute new file, src/die.h
Jim Meyering [Sat, 15 Oct 2016 22:27:48 +0000 (15:27 -0700)] 
build: also distribute new file, src/die.h

* src/local.mk (noinst_HEADERS): Add die.h.

8 years agobuild: add die.h; avoid new warnings from GCC 7
Jim Meyering [Wed, 5 Oct 2016 02:20:46 +0000 (19:20 -0700)] 
build: add die.h; avoid new warnings from GCC 7

* src/die.h (die): New file/function from grep.
Note: we expect this file to migrate to gnulib.
* src/csplit.c: Include die.h.
(check_format_conv_type): Use die in place of error-nonzero;break;
* src/install.c (strip): Likewise.
* src/nl.c (proc_text): Likewise.  This also suppresses a new warning
from GCC 7's -Werror=strict-overflow.
* src/tail.c (parse_options): Likewise.
* src/basename.c (main): Adjust "fall through" comment
so that GCC 7's -Wimplicit-fallthrough honors it.
* src/cp.c (main): Add a "fall through" comment.
* src/ls.c (gobble_file): Likewise.
(get_funky_string): Adjust a "fall through" comment so it is
recognized.
* cfg.mk (exclude_file_name_regexp--sc_system_h_headers): Add die.h
to this list of exempt src/*.h files.

8 years agomaint: pr: avoid new GCC 7 warning
Jim Meyering [Wed, 14 Sep 2016 18:48:33 +0000 (11:48 -0700)] 
maint: pr: avoid new GCC 7 warning

* src/pr.c (main): Avoid this warning from GCC 7:
src/pr.c:1119:6: error: assuming signed overflow does not occur when \
  simplifying conditional to constant [-Werror=strict-overflow]
   if (n_files == 0)

8 years agognulib: update to latest and adapt printf-quote.sh test
Jim Meyering [Mon, 3 Oct 2016 16:00:48 +0000 (09:00 -0700)] 
gnulib: update to latest and adapt printf-quote.sh test

* .gitignore: Add /lib/limits.h.
* tests/misc/printf-quote.sh: Reflect that a single quote is now
rendered as "'", rather than as ''\'''.

8 years agorm: disallow --n alias for --no-preserve-root
Pádraig Brady [Tue, 4 Oct 2016 12:43:32 +0000 (13:43 +0100)] 
rm: disallow --n alias for --no-preserve-root

* src/rm.c (main): Ensure the full --no-preserve-root
option is specified, rather than allowing --n etc.
* tests/rm/r-root.sh: Add a test case.
* NEWS: Mention the change in behavior.

Improved by Jim Meyering.
Fixes http://bugs.gnu.org/24604

8 years agotail: -F now always processes initially untailable files
Pádraig Brady [Wed, 21 Sep 2016 17:42:40 +0000 (18:42 +0100)] 
tail: -F now always processes initially untailable files

which was not the case when inotify was not available.

* src/tail.c (any_live_files): Simplify, since the IGNORE
flag is now only set when a file should be ignored indefinitely.
(recheck): Only output the "giving up on name" message
when that's actually the case.  Only set the IGNORE flag
when ignoring a file indefinitely.
(tail_file): Likewise.
* tests/tail-2/retry.sh: Add a test case.  Also run
all existing test cases with and without inotify.
NEWS: Mention the fix.
THANKS.in: Add the reporter.
Fixes http://bugs.gnu.org/24495 which was detected
using Symbolic Execution techniques developed in
the course of the SYMBIOSYS research project at
COMSYS, RWTH Aachen University.

8 years agowho: avoid new warning from upcoming gcc-7
Jim Meyering [Thu, 22 Sep 2016 14:56:15 +0000 (07:56 -0700)] 
who: avoid new warning from upcoming gcc-7

* src/who.c (idle_string): This function would fail to compile
with -Werror and today's built-from-git gcc due to this warning:
src/who.c: In function 'print_user':
src/who.c:201:36: error: may write format character ':' at offset 4 \
  past the end of the destination [-Werror=format-length=]
           sprintf (idle_hhmm, "%02d:%02d",
                                    ^~~~~
The fix is to use an assertion to inform gcc of the existing
invariant that guarantees the number of hours is less than 24.

8 years agols: fix %%b format and precompute more
Paul Eggert [Mon, 19 Sep 2016 19:36:18 +0000 (12:36 -0700)] 
ls: fix %%b format and precompute more

The old code mishandled --time-spec='+%%b', as it misinterpreted
the '%b' as being the month abbreviation.  Also, it mishandled
the extremely unlikely case of a month abbreviation containing '%'.
The performance part of this patch sped up 'ls' by about 1% on my
little benchmark of 'ls -lR' on the source directory in the
en_US.UTF-8 locale (Fedora 24 x86-64).
* NEWS: Document the bug fix.
* src/ls.c (first_percent_b, abformat_init): New static functions.
(ABFORMAT_SIZE): New constant.
(use_abformat): New static var.
(abmon, required_mon_width): Remove these static vars.
(abmon_init): Now accepts a pointer to abmon, and returns a boolean.
All callers changed.  Reject month abbrs containing '%', as these
would mess up strftime.  Simplify mbsalign result checking,
since (size_t) -1 exceeds ABFORMAT_SIZE.
(abformat_init, align_nstrftime): Precompute all 24 formats at
startup, rather than computing a format for each time stamp.
(decode_switches): Call abformat_init instead of abmon_init.
(align_nstrftime): Accept recentness bool instead of format.
All callers changed.
* tests/misc/time-style.sh: Test for format with '%%b'.

8 years agopinky,who: remove redeclarations of ttyname
George Burgess IV [Sat, 10 Sep 2016 06:43:19 +0000 (23:43 -0700)] 
pinky,who: remove redeclarations of ttyname

Given that `ttyname` is already conditionally declared in src/system.h,
other declarations are redundant and problematic for example in ChromeOS
which has a new FORTIFY implementation that, as an artifact of how it's
implemented, causes the compiler to complain if certain standard library
functions are redeclared without special compiler-specific attributes.

* src/pinky.c: Remove declaration (which was unused anyway).
* src/who.c: Remove declaration.
* src/system.h (getlogin, getuid, geteuid, getgrgid, getpwuid, ttyname):
Add the parameter type to the declarations to avoid warnings when these
backup declarations are used.

8 years agognulib: update to latest, for getprogname fixes
Jim Meyering [Sat, 10 Sep 2016 01:46:55 +0000 (18:46 -0700)] 
gnulib: update to latest, for getprogname fixes

Compiling in gnulib-tests/ would fail on some platforms
due to a missing lib/assert.h.  Reported by Assaf Gordon in
https://lists.gnu.org/archive/html/coreutils/2016-09/msg00016.html

8 years agocp: use FICLONE instead of BTRFS_IOC_CLONE
Paul Eggert [Fri, 9 Sep 2016 22:28:31 +0000 (15:28 -0700)] 
cp: use FICLONE instead of BTRFS_IOC_CLONE

This doesn't affect the generated code on my system; it's merely
a cleaner way to use the recently-introduced Linux-specific API.
* m4/jm-macros.m4 (gl_CHECK_ALL_HEADERS): Check for linux/fs.h.
* src/copy.c: Include <linux.fs.h> if available.
(FICLONE) [__linux__]: Define if not already defined.
(clone_file): Use FICLONE instead of the older BTRFS_IOC_CLONE,
as this ioctl is no longer btrfs-specific.

8 years agodate: add '--debug' option
Assaf Gordon [Thu, 8 Sep 2016 05:00:23 +0000 (01:00 -0400)] 
date: add '--debug' option

Usage example:
    date --debug -d 'now + 3 days'

Print parsing and debugging information to stderr when using date's
-d/--date option.
See: http://lists.gnu.org/archive/html/coreutils/2016-01/msg00076.html

* src/date.c (main): Add '--debug' option, enable debugging
in gnulib's parse-datetime.y module.
* tests/misc/date.pl: Repeat tests with '--debug' enable, ensure
no regression.
* tests/misc/date-debug.sh: Test output of '--debug' option.
* tests/local.mk: Add above test.
* NEWS: Mention new option.
* doc/coreutils.texi: Likewise.

8 years agosort: port to strict C + valgrind
Paul Eggert [Thu, 8 Sep 2016 02:49:55 +0000 (19:49 -0700)] 
sort: port to strict C + valgrind

* bootstrap.conf (gnulib_modules): Add flexmember.
* src/sort.c: Include flexmember.h.
(struct tempnode): Make the last member flexible.
(create_temp_file): Port to strict C11/C99 rules for
allocation alignment with flexible array members.

8 years agobuild: update gnulib submodule to latest
Paul Eggert [Thu, 8 Sep 2016 01:31:16 +0000 (18:31 -0700)] 
build: update gnulib submodule to latest

8 years agofactor: reinstate immediate output with interactive use
Pádraig Brady [Tue, 6 Sep 2016 14:13:32 +0000 (15:13 +0100)] 
factor: reinstate immediate output with interactive use

* src/factor.c (lbuf_putc): Only buffer more than a line
when not using the tool interactively.
* NEWS: Mention the bug fix.
Fixes http://pad.lv/1620139

8 years agols: allow interruption when reading slow directories
Kamil Dudka [Tue, 6 Sep 2016 15:38:26 +0000 (17:38 +0200)] 
ls: allow interruption when reading slow directories

Postpone installation of signal handlers until they're needed.
That is right before the first escape sequence is printed.

* src/ls.c (signal_setup): A new function refactored from main()
to set and restore signal handlers.
(main): Move signal handler setup to put_indicator()
so that the default signal handling is untouched as long as possible.
Adjusted condition for restoring signal handlers to reflect the change.
(put_indicator): Install signal handlers if called for the very first
time.  It uses the same code that was in main() prior to this commit.
* NEWS: Mention the improvement.

See https://bugzilla.redhat.com/1365933
Fixes http://bugs.gnu.org/24232

8 years agodoc: fix typo in date example
Pádraig Brady [Thu, 1 Sep 2016 15:39:04 +0000 (16:39 +0100)] 
doc: fix typo in date example

* doc/coreutils.texi (date invocation): Add a missing quotation mark.
Fixes http://bugs.gnu.org/24349

8 years agodircolors: recognize .zst and .tzst suffixes
Jim Meyering [Wed, 27 Jul 2016 16:30:02 +0000 (09:30 -0700)] 
dircolors: recognize .zst and .tzst suffixes

* src/dircolors.hin: Add .zst and .tzst suffixes for the
Zstandard/zstd compression tools.  See http://zStd.net and
https://code.facebook.com/posts/1658392934479273/

8 years agomaint: tr: tweak/make-consistent a pair of loop indices
Jim Meyering [Fri, 25 Sep 2015 01:28:16 +0000 (18:28 -0700)] 
maint: tr: tweak/make-consistent a pair of loop indices

* src/tr.c (unquote): Use indices of type "unsigned int", rather
than a mix or "size_t" and "int", presuming that no command-line-
specified string will have length longer than UINT_MAX.

8 years agotr: move decls "down"
Jim Meyering [Thu, 17 Sep 2015 03:07:42 +0000 (20:07 -0700)] 
tr: move decls "down"

8 years agoptx: avoid new warning/error from upcoming gcc-7.x
Jim Meyering [Mon, 29 Aug 2016 05:53:50 +0000 (22:53 -0700)] 
ptx: avoid new warning/error from upcoming gcc-7.x

* src/ptx.c (fix_output_parameters): Switch to an unsigned type that
matches the OCCURS.file_index type. This avoids the following error
from gcc-7.0.0 20160829 (experimental):
  src/ptx.c:1220:14: error: assuming signed overflow does not occur \
    when simplifying conditional to constant [-Werror=strict-overflow]
          if (file_index > 0)

8 years agocp: with --parents --no-preserve=mode don't copy dir perms
Pádraig Brady [Thu, 18 Aug 2016 12:54:48 +0000 (13:54 +0100)] 
cp: with --parents --no-preserve=mode don't copy dir perms

* src/cp.c (make_dir_parents_private): Use default permissions for
created directories when --no-preserve=mode is specified.
* tests/cp/cp-parents.sh: Add a test case.
* NEWS: Mention the fix.
Fixes http://bugs.gnu.org/24251

8 years agodoc: fix ambiguous multiplier info in dd man page
Pádraig Brady [Thu, 18 Aug 2016 10:58:39 +0000 (11:58 +0100)] 
doc: fix ambiguous multiplier info in dd man page

* src/dd.c (usage): Add a comma which is significant for
the rewrapping done in man pages.

9 years agomaint: refactor common expand(1) and unexpand(1) code
Assaf Gordon [Sat, 25 Jun 2016 01:48:29 +0000 (21:48 -0400)] 
maint: refactor common expand(1) and unexpand(1) code

* src/expand.c, src/unexpand.c: Move global variables from here...
* src/expand-common.h, src/expand-common.c: ... to here.
* src/expand.c, src/unexpand.c: (parse_tab_stops, validate_tab_stops,
next_file): Move identical functions to new module.
(add_tab_stop): Move to new module, including additional code from
'unexpand' (keeping max_column_width) which will have no effect in when
used in 'expand'. Refactor common next-column calculation code
into a new function 'get_next_tab_column'.
* src/local.mk: (src_expand_SOURCES, src_unexpand_SOURCES): Add
'expand-common.c'; (noinst_HEADERS): Add 'expand-common.h'.
* po/POTFILES.in: Add 'expand-common.c'.
* tests/misc/expand.pl: Add more tests.
* tests/misc/unexpand.pl: Likewise.
* TODO: Move conclusions to above test after investigation.

9 years agodf: improve performance with many mount points
Philipp Thomas [Sun, 31 Jul 2016 19:24:18 +0000 (21:24 +0200)] 
df: improve performance with many mount points

Use hash table for seaching in filter_mount_list() and get_dev()

This improves performance for 20K mount entries from:
  real    0m1.731s
  user    0m0.532s
  sys     0m1.188s
to:
  real    0m1.066s
  user    0m0.028s
  sys     0m1.032s

* src/df.c (devlist_table): Define hash table.
(devlist_hash): Add hash function.
(devlist_compare): Add hash comparison function.
(devlist_for_dev): Add lookup function.
(devlist_free): Add cleanup function.
(filter_mount_list): Use the above hash table.
While at it, rename the variable 'devlist' to 'seen_dev' for
better readability.
(me_for_dev): Use the above lookup function.
NEWS: Mention the improvement.
THANKS.in: Remove the committer; add original submitter Josef Cejka.

9 years agodoc: revert recent date(1) synopsis change
Pádraig Brady [Thu, 28 Jul 2016 11:38:20 +0000 (12:38 +0100)] 
doc: revert recent date(1) synopsis change

* src/date.c (usage): This was thought to introduce other ambiguities,
and was inconsistent with the format presented in the touch(1) docs.
* doc/coreutils.texi (date invocation): Likewise.
See http://bugs.gnu.org/24077

9 years agomaint: pacify GCC 6 with -Wnull-dereference
Bernhard Voelker [Wed, 27 Jul 2016 07:33:19 +0000 (09:33 +0200)] 
maint: pacify GCC 6 with -Wnull-dereference

src/id.c:249:29: error: potential null pointer dereference \
[-Werror=null-dereference]
       pw_name = xstrdup (pwd->pw_name);
                          ~~~^~~~~~~~~
src/whoami.c:89:11: error: potential null pointer dereference \
[-Werror=null-dereference]
   puts (pw->pw_name);
         ~~^~~~~~~~~

* src/id.c (main): Explicitly exit with EXIT_FAILURE after an eror to
help gcc-6 to detect that the dereferenced pointer is valid.
* src/whoami.c (main): Likewise.

9 years agobuild: update gnulib submodule to latest
Bernhard Voelker [Wed, 27 Jul 2016 07:33:18 +0000 (09:33 +0200)] 
build: update gnulib submodule to latest

Mainly for
77d36b5 obstack: pacify GCC 6 with -Wnull-dereference

9 years agomaint: skip a check when en_US.UTF-8 collation rules are broken
Jim Meyering [Mon, 25 Jul 2016 15:37:28 +0000 (08:37 -0700)] 
maint: skip a check when en_US.UTF-8 collation rules are broken

* cfg.mk (sc_THANKS_in_sorted): This check would fail on systems
for which "." is not ignored.  Add a quick sort-based check for
that error, and skip the check on any broken system.

9 years agodoc: make date(1) synopsis consistent with output +FORMAT
Pádraig Brady [Wed, 27 Jul 2016 09:05:20 +0000 (10:05 +0100)] 
doc: make date(1) synopsis consistent with output +FORMAT

* src/date.c (usage): Make the characters used to summarize
the input format, match the output +FORMAT characters.
* doc/coreutils.texi (date invocation): Likewise.
Fixes http://bugs.gnu.org/24077

9 years agomaint: fix dependency of man/arch.1
Bernhard Voelker [Tue, 26 Jul 2016 18:58:08 +0000 (20:58 +0200)] 
maint: fix dependency of man/arch.1

The following is a reproducer for the wrong dependency:

  $ ./configure --enable-install-program=arch
  $ make
  $ rm -f src/arch man/arch.1
  $ make man/arch.1
    GEN      man/arch.1
  help2man: can't get `--help' info from man/arch.td/arch
  Try `--no-discard-stderr' if option outputs to stderr
  Makefile:14378: recipe for target 'man/arch.1' failed
  make: *** [man/arch.1] Error 127

* man/local.mk (man/arch.1): Change to depend on src/arch rather than
src/uname: while the arch binary depends on uname.c and uname-arch.c,
its man page depends on the arch binary.

Reported downstream by Rodrigues Goldwyn <rgoldwyn@suse.com> in
https://build.opensuse.org/request/show/415172

9 years agosort: with -h, disallow thousands separator between number and unit
Kamil Dudka [Mon, 18 Jul 2016 17:04:45 +0000 (19:04 +0200)] 
sort: with -h, disallow thousands separator between number and unit

* src/sort.c (traverse_raw_number): Accept thousands separator only
if it is immediately followed by a digit.
* tests/misc/sort-h-thousands-sep.sh: Cover the fix for this bug.

Suggested by Pádraig Brady in http://bugs.gnu.org/24015

9 years agosort: make -h work with -k and blank used as thousands separator
Kamil Dudka [Mon, 18 Jul 2016 17:04:44 +0000 (19:04 +0200)] 
sort: make -h work with -k and blank used as thousands separator

* src/sort.c (traverse_raw_number): Allow to skip only one occurrence
of thousands_sep to avoid finding the unit in the next column in case
thousands_sep matches as blank and is used as column delimiter.
* tests/misc/sort-h-thousands-sep.sh: Add regression test for this bug.
* tests/local.mk: Reference the test.
* NEWS: Mention the bug fix.
Reported at https://bugzilla.redhat.com/1355780
Fixes http://bugs.gnu.org/24015

9 years agomaint: sort.c: deduplicate code for traversing numbers
Kamil Dudka [Mon, 18 Jul 2016 17:04:43 +0000 (19:04 +0200)] 
maint: sort.c: deduplicate code for traversing numbers

* src/sort.c (traverse_raw_number): New function for traversing numbers.
(find_unit_order): Use traverse_raw_number() instead of open-coding it.
(debug_key): Likewise.

9 years agoinstall: with -Z, set default SELinux context for created directories
Kamil Dudka [Fri, 8 Jul 2016 16:59:35 +0000 (18:59 +0200)] 
install: with -Z, set default SELinux context for created directories

* doc/coreutils.texi (install invocation): Update -Z documentation.
* src/install.c (make_ancestor): Set default security context before
calling mkdir() if the -Z option is given.
(process_dir): Call restorecon() on the destination directory if the
-Z option is given.
(usage): Update -Z documentation.
* tests/install/install-Z-selinux.sh: A new test for 'install -Z -D'
and 'install -Z -d' based on tests/mkdir/restorecon.sh.
* tests/local.mk: Reference the test.
* NEWS: Mention the improvement.
Reported at https://bugzilla.redhat.com/1339135
Fixes http://bugs.gnu.org/23868

9 years agotests: avoid false failure on 32 bit in readdir() test
Pádraig Brady [Wed, 6 Jul 2016 17:08:32 +0000 (18:08 +0100)] 
tests: avoid false failure on 32 bit in readdir() test

* tests/rm/rm-readdir-fail.sh: Since we use the returned dirent
from the readdir wrapper it must be the correct type and not
just cast.  Therefore setup so that we only have to define a
wrapper for readdir(), which works appropriately on 32 and 64 bit.
Issue reported by Bernhard Voelker, where rm was seen to invoke
rmdir() on invalid file names.

9 years agotests: improve recent seq EPIPE test
Assaf Gordon [Sun, 1 May 2016 19:43:59 +0000 (15:43 -0400)] 
tests: improve recent seq EPIPE test

Follow-up to commit c92585b1: improve epipe test script, with
suggestions from Bernhard Voelker and Pádraig Brady.
see: http://lists.gnu.org/archive/html/coreutils/2016-04/msg00067.html .

* tests/misc/seq-epipe.sh: Avoid too many subshells,
  stricter validation of errors and output from seq,
  skip if trapping SIGPIPE is not supported.

9 years agostty: fix sane setting of susp to ^z on Solaris
Pádraig Brady [Wed, 29 Jun 2016 08:49:01 +0000 (09:49 +0100)] 
stty: fix sane setting of susp to ^z on Solaris

* src/stty.c: Disable setting of "swtch" to ^z as that
conflicts with and disables using ^z as "susp".
* NEWS: Mention the bug fix.
Reported and tested by Rich Burridge at:
http://bugs.gnu.org/23866

9 years agotests: verify that fts diagnoses readdir() failures
Peter Benie [Sun, 26 Jun 2016 18:07:45 +0000 (19:07 +0100)] 
tests: verify that fts diagnoses readdir() failures

* tests/rm/rm-readdir-fail.sh: A new test to simulate readdir()
failing immediately or after returning a few entries, and verifying
that rm does the appropriate thing.
This was initially reported at:
http://bugzilla.opensuse.org/show_bug.cgi?id=984910
where it was mentioned that readdir() may fail
when an NFS server has a poor readdir cookie implementation.

9 years agoall: update gnulib submodule and tests/init.sh to latest
Pádraig Brady [Sun, 26 Jun 2016 19:58:41 +0000 (20:58 +0100)] 
all: update gnulib submodule and tests/init.sh to latest

* gnulib: Update to latest.
* NEWS: Specifically mention the fts readdir() fix
and reindent to standard indentation.
* tests/init.sh: Update from gnulib.

9 years agomaint: simplify partial writes etc. in 'yes'
Paul Eggert [Fri, 24 Jun 2016 22:58:44 +0000 (00:58 +0200)] 
maint: simplify partial writes etc. in 'yes'

* src/yes.c: Include full-write.h.
(main): Use full_write, not write, to simplify handling of partial
writes.  Don't bother using stdio to output data; just use
full_write with a buffer as large as needed.  Reuse operand
strings if possible, and if the buffer would otherwise be large.

9 years agoyes: handle short writes
Pádraig Brady [Thu, 23 Jun 2016 13:15:59 +0000 (14:15 +0100)] 
yes: handle short writes

* src/yes.c (main): Loop over the write buffer to
handle the case where write may write less than requested.
* NEWS: Mention the bug fix.
Reported by Paul Eggert.

9 years agoyes: fix copy and paste issue with previous commit
Pádraig Brady [Fri, 24 Jun 2016 00:09:28 +0000 (01:09 +0100)] 
yes: fix copy and paste issue with previous commit

* src/yes.c (main): Output 'y' not '-'.
* tests/misc/yes.sh: Add a test for default output.

9 years agomaint: work even if argc == INT_MAX
Paul Eggert [Thu, 23 Jun 2016 18:16:45 +0000 (20:16 +0200)] 
maint: work even if argc == INT_MAX

GCC 7 warned about undefined behavior in this unlikely case.
Problem reported by Jim Meyering in: http://bugs.gnu.org/23825
* src/md5sum.c (main):
* src/paste.c (main):
* src/yes.c (main):
Avoid undefined behavior when argc == INT_MAX.

9 years agodoc: clarify sort --key handling of default field separators
Pádraig Brady [Wed, 1 Jun 2016 10:56:47 +0000 (11:56 +0100)] 
doc: clarify sort --key handling of default field separators

* doc/coreutils.texi (sort invocation): Mention in the summary
dicussion that --key is used to specify fields.  Give a summary
in the --key description, of the most common use case of specifying
a field, and that by default those fields include the blank separators
at the start of each field in the comparisons.

9 years agosort: modify 'leading spaces' debug warning scenarios
Assaf Gordon [Wed, 1 Jun 2016 00:19:38 +0000 (20:19 -0400)] 
sort: modify 'leading spaces' debug warning scenarios

Print warning regardless of locale, avoid warning if key is zero width.
Problem reported by Karl Berry in http://bugs.gnu.org/23665 .

* src/sort.c: (key_warnings): change conditions for 'leading spaces'
warning.
* tests/misc/sort-debug-warn.sh: adjust tests accordingly.

9 years agotests: sort-debug-warn: add progress information lines
Assaf Gordon [Wed, 1 Jun 2016 00:11:34 +0000 (20:11 -0400)] 
tests: sort-debug-warn: add progress information lines

Easier troubleshooting of individual 'sort --debug' messages.
Discussed in http://bugs.gnu.org/23665 .

* tests/misc/sort-debug-warn.sh: add progress number before each sort
invocation.

9 years agodircolors: output colors for any $TERM matching *color*
Pádraig Brady [Sun, 15 May 2016 20:23:42 +0000 (21:23 +0100)] 
dircolors: output colors for any $TERM matching *color*

* src/dircolors.hin: Reduce the list by replacing all specific
mentions of "color" with the pattern "*color*".  This will also
cater for other entries like "konsole-256color".
Fixes http://bugs.gnu.org/23542

9 years agonl: reset numbering for each section
KOBAYASHI Takashi [Sun, 1 May 2016 12:47:25 +0000 (13:47 +0100)] 
nl: reset numbering for each section

* NEWS: Mention the bug fix.
* src/nl.c (proc_body, proc_footer): Reset numbering here too.
* doc/coreutils.texi (nl invocation): Adjust for behavior change.
* tests/misc/nl.sh: Add a test case.

9 years agostat,tail: add support for the SMB2 remote file system
Pádraig Brady [Thu, 12 May 2016 08:50:48 +0000 (09:50 +0100)] 
stat,tail: add support for the SMB2 remote file system

* stc/stat.c (human_fstype): Add file system ID definition,
and use "smb2" as the name.
* NEWS (Improvements): Mention the change.
Fixes http://bugs.gnu.org/23516

9 years agomaint: avoid new warning from gcc (GCC) 7.0.0 20160503 (experimental)
Jim Meyering [Wed, 4 May 2016 03:56:20 +0000 (20:56 -0700)] 
maint: avoid new warning from gcc (GCC) 7.0.0 20160503 (experimental)

* src/id.c (main): When configured with --enable-gcc-warnings and using
the very latest gcc built from git, building would fail with this:
  src/id.c:200:8: error: assuming signed overflow does not occur when \
    simplifying conditional to constant [-Werror=strict-overflow]
     bool default_format = (just_user + just_group + just_group_list
          ^~~~~~~~~~~~~~
Rewrite to use bool-appropriate operators.

9 years agotests: avoid false failure when df lists no root file system
Pádraig Brady [Mon, 25 Apr 2016 22:12:14 +0000 (23:12 +0100)] 
tests: avoid false failure when df lists no root file system

* tests/df/skip-duplicates.sh: Skip the test when there is no
'/' entry listed by df, which was seen in certain chroot setups.

9 years agoseq: detect and report I/O errors immediately
Assaf Gordon [Sun, 17 Apr 2016 06:28:13 +0000 (02:28 -0400)] 
seq: detect and report I/O errors immediately

Ensure I/O errors are detected (and terminate seq), preventing seq
from infloop (or running for long time with a large
range) upon write errors or ignored SIGPIPE. Examples:

     seq 1 inf > /dev/full             (seq_fast)
     seq 1.1 0.1 inf >/dev/full        (print_numbers)

* src/seq.c (io_error): A new function to diagnose appropriate
stdio errors and exit the program with failure status.
(seq_fast, print_numbers): Explicitly check for write errors
and terminate the program with diagnostic.
* tests/misc/seq-io-errors.sh: Test error detection with /dev/full.
* tests/misc/seq-epipe.sh: Test error detection with broken pipes.
* tests/local.mk: Add new tests.
* NEWS: Mention the fix.

9 years agostat,tail: add support for Windows Subsystem for Linux
Pádraig Brady [Thu, 21 Apr 2016 20:48:50 +0000 (21:48 +0100)] 
stat,tail: add support for Windows Subsystem for Linux

* src/stat.c (human_fstype): Add file system ID definition,
and use "wslfs" as the name.
* NEWS (Improvements): Mention the change.
Fixes http://bugs.gnu.org/23273

9 years agoyes: avoid redundant diagnostics on write error
Pádraig Brady [Mon, 4 Apr 2016 12:17:34 +0000 (13:17 +0100)] 
yes: avoid redundant diagnostics on write error

* src/yes.c (main): For large inputs only write a single
diagnostic for write errors.
* tests/misc/yes.sh: Test when /dev/full is available.

9 years agosleep,timeout: support overflowing floating point values
Pádraig Brady [Wed, 20 Apr 2016 17:26:58 +0000 (18:26 +0100)] 
sleep,timeout: support overflowing floating point values

* src/sleep.c (main): Allow ERANGE since we allow "inf" values.
* src/timeout.c (parse_duration): Likewise.
* tests/misc/sleep.sh: New file. Tests for sleep(1).
* tests/misc/timeout-parameters.sh: Add case for newly allowed
$LDBL_MAX.  Also use returns_ throughout the file.  Also avoid
small timeout values which might give false failures under load.

9 years agotests: avoid potential overflows with `expr`
Pádraig Brady [Wed, 20 Apr 2016 13:03:05 +0000 (14:03 +0100)] 
tests: avoid potential overflows with `expr`

* cfg.mk (sc_prohibit_expr_unsigned): expr uses intmax_t internally
when GMP is not available, so flag any uses of unsigned limits.
* tests/misc/timeout-parameters.sh: Remove the overflow related
to UINT_MAX as it's handled by the following case.  Change the
following case from 99... to $TIME_T_OFLOW to be more expressive
in what it's actually testing.  Directly check that commands succeed,
rather than inspecting $? afterwards.
* tests/dd/skip-seek-past-dev.sh: Guard against large device sizes.
* tests/id/setgid.sh: Protect: Guard against large group IDs.
* tests/misc/cut-huge-range.sh: Tweak comment to avoid syntax check.
It's tempting to simplify to just skip the test if expr fails,
but SIZE_MAX > INTMAX_MAX is the common case.

9 years agotests: fix recent false failure due to a race
Pádraig Brady [Wed, 20 Apr 2016 16:00:47 +0000 (17:00 +0100)] 
tests: fix recent false failure due to a race

* tests/cp/parent-perm-race.sh: This new race introduced in
commit v8.25-5-g632eda5 is quite hard to hit, but is due to
`ls > fifo` doing write()/close()/exit() once `cp` has
open() the source fifo.  Then the subsequent comparison of the
destination file may fail due to the file being missing or empty.
Previously `ls` generated output that was independent of `cp`.
Now we must wait for `cp` to finish before inspecting the
destination file that it wrote.

9 years agotests: let mkdir/p-v.sh fail when compare fails
Bernhard Voelker [Sun, 17 Apr 2016 11:19:22 +0000 (13:19 +0200)] 
tests: let mkdir/p-v.sh fail when compare fails

* tests/mkdir/p-v.sh: Set fail=1 when compare fails: the latter only
sets a non-Zero return code; evaluating that is up to the caller.

9 years agoseq: do not allow NaN arguments
Bernhard Voelker [Thu, 14 Apr 2016 10:39:28 +0000 (12:39 +0200)] 
seq: do not allow NaN arguments

* src/seq.c (isnan): Define macro.
(scan_arg): Add check if the given argument is NaN, and exit with
a proper error diagnostic in such a case.
(usage): Document it.
* tests/misc/seq.pl: Add tests.
* doc/coreutils.texi (seq invocation): Document the change.
* NEWS (Changes in behavior): Mention the change.

9 years agoseq: do not allow 0 as increment value
Bernhard Voelker [Thu, 14 Apr 2016 10:38:09 +0000 (12:38 +0200)] 
seq: do not allow 0 as increment value

* src/seq.c (main): Exit with an error diagnostic when the given
step value is Zero.
(usage): Document it.
* doc/coreutils.texi (seq invocation): Likewise.
* tests/misc/seq.pl: Add tests.
* NEWS (Changes in behavior): Mention the change.
Reported by Маренков Евгений in:
http://bugs.gnu.org/23110

9 years agostat,tail: add support for M1FS
Yigal Korman [Wed, 13 Apr 2016 13:15:20 +0000 (16:15 +0300)] 
stat,tail: add support for M1FS

* src/stat.c (human_fstype): Add file system ID definition.
* NEWS (Improvements): Mention the change, moving the previously added
"prl_fs" change note from "Changes in behavior" to here.
Fixes http://bugs.gnu.org/23283

9 years agostat: report type for "prl_fs" file systems
Pádraig Brady [Thu, 31 Mar 2016 15:34:28 +0000 (16:34 +0100)] 
stat: report type for "prl_fs" file systems

* src/stat.c (human_fstype): Identify the parallels file system.
Also tag as remote so that tail(1) doesn't use inotify, which
fails to detect changes made outside a VM.
Fixes http://bugs.gnu.org/23143

9 years agodate ls pr: fix time zone abbrs on SysV platforms
Paul Eggert [Thu, 17 Mar 2016 17:35:18 +0000 (10:35 -0700)] 
date ls pr: fix time zone abbrs on SysV platforms

The problematic code computed a struct tm in one time zone, and
then printed it or converted it to a string in another.  To be
portable the same time zone needs to be used for both operations.
On GNU platforms this is not an issue, but incorrect output can be
generated on System V style platforms like AIX where time zone
abbreviations are available only in the 'tzname' global variable.
Problem reported by Assaf Gordon in: http://bugs.gnu.org/23035
* NEWS: Document the bug.
* src/date.c (show_date):
* src/ls.c (long_time_expected_width, print_long_format):
* src/pr.c (init_header):
* src/stat.c (human_time): Use localtime_rz instead of localtime,
so that the time zone information is consistent for both localtime
and time-formatting functions like fprintftime and nstrftime.  For
'stat' this change is mostly just a code cleanup but it also
causes stat to also print nanoseconds when printing time stamps
that are out of localtime range, as this is more consistent with
what other programs do.  For programs other than 'stat' this fixes
bugs with time zone formats that use %Z.
* src/du.c, src/pr.c (localtz): New static var.
(main): Initialize it.
* src/du.c (show_date): New time zone argument, so that localtime
and fprintftime use the same time zone information.  All callers
changed.
* tests/misc/time-style.sh: New file.
* tests/local.mk (all_tests): Add it.
* tests/misc/date.pl: Test alphabetic time zone abbreviations.

9 years agomaint: remove gl/lib/reg*.c.diff; no longer needed
Jim Meyering [Mon, 14 Mar 2016 15:59:56 +0000 (08:59 -0700)] 
maint: remove gl/lib/reg*.c.diff; no longer needed

* gl/lib/regcomp.c.diff: Remove file, now that gnulib's
regcomp.c compiles regex.c with -Wno-unused-parameter.
* gl/lib/regex_internal.h.diff: Likewise.
* gl/lib/regex_internal.c.diff: This file induced a change to ensure
that the "Idx" type was unsigned and to remove a few "VAR < 0"
comparisons.  These days, it is probably fine to stay in sync with
gnulib/glibc's copies
of these files, so remove these patches, too.
* gl/lib/regexec.c.diff: Likewise.
Prompted by a report by Assaf Gordon and a suggestion from Paul Eggert.

9 years agobuild: update gnulib submodule to latest
Eric Blake [Tue, 8 Mar 2016 23:01:34 +0000 (16:01 -0700)] 
build: update gnulib submodule to latest

Mainly for:
*bdb72bc6 set-permissions: fix compilation on Cygwin

* bootstrap: Sync with gnulib.
* gl/lib/regcomp.c.diff: Regenerate against latest gnulib.

9 years agotests: avoid false-failure of split/filter.sh on XFS
Jim Meyering [Mon, 7 Mar 2016 00:38:01 +0000 (16:38 -0800)] 
tests: avoid false-failure of split/filter.sh on XFS

* tests/split/filter.sh: Use OFF_T_MAX-1 rather than OFF_T_MAX
as the size of a test file, to avoid false failure on an XFS file
system (or any file system permitting a file of size OFF_T_MAX).
Reported as http://bugs.gnu.org/22931

9 years agotest: Document that -a and -o are undesirable
Eric Blake [Fri, 4 Mar 2016 16:47:33 +0000 (09:47 -0700)] 
test: Document that -a and -o are undesirable

POSIX recommends avoiding -a and -o, for good reason.
src/test.c (usage): Mention that inherent ambiguities exist with
binary -a and -o.
Problem reported by Martin Gebert in: http://bugs.gnu.org/22909

9 years agoall: be less strict about usage if POSIX 2008
Paul Eggert [Tue, 23 Feb 2016 09:03:55 +0000 (01:03 -0800)] 
all: be less strict about usage if POSIX 2008

sort, tail, and uniq now support traditional usage like 'sort +2'
and 'tail +10' on systems conforming to POSIX 1003.1-2008 and later.
* NEWS: Document this.
* doc/coreutils.texi (Standards conformance, tail invocation)
(sort invocation, uniq invocation, touch invocation):
Document new behavior, or behavior's dependence on POSIX 1003.1-2001.
* src/sort.c (struct keyfield.traditional_used):
Rename from obsolete_used, since implementations are now allowed
to support it.  All uses changed.
(main): Allow traditional usage if _POSIX2_VERSION is 200809.
* src/tail.c (parse_obsolete_option): Distinguish between
traditional usage (which POSIX 2008 and later allows) and obsolete
(which it still does not).
* src/uniq.c (strict_posix2): New function.
(main): Allow traditional usage if _POSIX2_VERSION is 200809.
* tests/misc/tail.pl: Test for new behavior.

9 years agodoc: document sort -o F F danger
Paul Eggert [Tue, 23 Feb 2016 07:48:36 +0000 (23:48 -0800)] 
doc: document sort -o F F danger

Problem reported by Yanyan Jiang 蒋炎岩 in: http://bugs.gnu.org/22769
* doc/coreutils.texi (sort invocation):
Mention possibility of 'sort -o F F' data loss during crashes.

9 years agodate: free timezone variable to avoid valgrind warning
Daniel Lockyer [Tue, 16 Feb 2016 16:52:07 +0000 (17:52 +0100)] 
date: free timezone variable to avoid valgrind warning

* src/date.c (main): Free TZ variable to pacify valgrind, guarded
by IF_LINT.

9 years agosplit: adjust recent --number changes
Pádraig Brady [Sat, 13 Feb 2016 04:15:51 +0000 (20:15 -0800)] 
split: adjust recent --number changes

* src/split.c (lines_rr): Reinstate the conditional
setting of the WROTE boolean, as otherwise split -n r/1 would
consume all input when all --filter commands are stopped.
There was a test in place to check for this, but
it was incorrect as detailed below.
(input_file_size): Immediately disallow --number with
non seekable inputs, as such an invocation is not currently
generally supported and will fail as the data overflows
the internal buffer.
* tests/split/l-chunk.sh: Adjust to again disallow -n /dev/zero.
Also change all '&& fail=1' checks to use the 'returns_ 1' form.
* tests/split/filter.sh: Change the no longer supported /dev/zero
case to a regular $OFF_T_MAX file (supported on XFS for example).
Also fix the timeout(1) commands so they're not subject to
pipefail issues.

9 years agostty: fix translated --help so the gettext header is not printed
Göran Uddeborg [Mon, 15 Feb 2016 21:00:52 +0000 (13:00 -0800)] 
stty: fix translated --help so the gettext header is not printed

* src/stty.c (usage): Remove an erroneous call to translate an
empty string, added in commit v8.23-112-g564f84a, which results
in the gettext header being printed for translated languages.
* THANKS.in: Remove the now committer.
* NEWS: Mention the bug fix.

9 years agotests: don't wait forever on GNU/Hurd
Paul Eggert [Fri, 12 Feb 2016 18:59:20 +0000 (10:59 -0800)] 
tests: don't wait forever on GNU/Hurd

* tests/cp/parent-perm-race.sh: Add timeouts so that the test does
not wait forever on GNU/Hurd.  This does not fix the underlying
bug but at least lets the tests make progress.
Problem reported by Nelson H.F. Beebe in: http://bugs.gnu.org/22624
Also, check that 'cp' actually copies the data; this is a better
test anyway, and simplifies the test code.
Also, avoid unlikely race if 'pid' is set in the environment.

9 years agosplit: fix problems with /dev/zero
Paul Eggert [Fri, 12 Feb 2016 18:16:11 +0000 (10:16 -0800)] 
split: fix problems with /dev/zero

Problem reported by Nelson H.F. Beebe in: http://bugs.gnu.org/22624
Other problems also fixed: basically, the code got confused because
GNU/Linux reports that /dev/zero has size zero.
* src/split.c (input_file_size): Now takes struct stat *, not just
size.  Always store the first buffer.  All callers changed.  Treat
/dev/zero as an infinitely-large file, both on GNU/Linux where
fstat and lseek say its size is zero, and on GNU/Hurd where they
say the size is OFF_T_MAX.
(cwrite): Return true on success.
(bytes_split): Don't try to read past EOF, and stop if a write fails.
(lines_rr): Omit stray check for ignorable errno.
(main): Get file size only when n_units > 1, since that's the only
time it is needed.  Defer most of the work to input_file_size.
* tests/split/l-chunk.sh: Adjust tests to match new behavior
on oddball inputs.

9 years agodoc: fix the --iso-8601 example in date --help
Vincent Lefevre [Sat, 30 Jan 2016 07:07:13 +0000 (23:07 -0800)] 
doc: fix the --iso-8601 example in date --help

* src/date.c (usage): The colon is used in the timezone offset
since commit v8.24-64-g17bbf6c.
* THANKS.in: Remove committer.
Fixes http://bugs.gnu.org/22491

9 years agobuild: avoid dynamic linking issue on Solaris sparc
Pádraig Brady [Mon, 25 Jan 2016 01:57:12 +0000 (17:57 -0800)] 
build: avoid dynamic linking issue on Solaris sparc

Solaris Studio 12 on sparc (not x86) will not remove
unused functions, thus leaving a reference to an
undefined program_name symbol from emit_try_help().

* src/system.h (emit_try_help): Change from an inline function
to a macro, so that the inline function is not actually
defined in libstdbuf.c.
Fixes http://bugs.gnu.org/22430

9 years agomaint: post-release administrivia
Pádraig Brady [Wed, 20 Jan 2016 10:56:02 +0000 (10:56 +0000)] 
maint: post-release administrivia

* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.

9 years agoversion 8.25 v8.25
Pádraig Brady [Wed, 20 Jan 2016 10:31:56 +0000 (10:31 +0000)] 
version 8.25

* NEWS: Record release date.

9 years agotests: avoid false failure in tail inotify test
Pádraig Brady [Tue, 19 Jan 2016 18:45:07 +0000 (18:45 +0000)] 
tests: avoid false failure in tail inotify test

* tests/tail-2/wait.sh: Restrict inotify specific test portion
to local file systems and also not with ---disable-inotify specified.
Failure noticed on NFS.

9 years agotests: avoid false failure due to remove() ignoring u-w on NFS
Pádraig Brady [Tue, 19 Jan 2016 17:49:11 +0000 (17:49 +0000)] 
tests: avoid false failure due to remove() ignoring u-w on NFS

* tests/rm/rm1.sh: Also remove the group write bit which
was required on one NFS setup at least.  Note u-w was
enough to deny file creation, g-w was also required to
deny file removal.
* tests/rm/cycle.sh: Likewise.
* tests/mv/perm-1.sh: Likewise.

9 years agotests: avoid false failure in preserve-slink-time.sh on GPFS
Pádraig Brady [Tue, 19 Jan 2016 15:51:00 +0000 (15:51 +0000)] 
tests: avoid false failure in preserve-slink-time.sh on GPFS

* tests/cp/preserve-slink-time.sh: Add a delay between the
ln and the cp so that there is enough difference between
the timestamps so GPFS won't discard the update.
Reported by Assaf Gordon.