]> git.ipfire.org Git - thirdparty/coreutils.git/log
thirdparty/coreutils.git
2 years agosplit: handle large numbers better
Paul Eggert [Sat, 4 Mar 2023 19:42:16 +0000 (11:42 -0800)] 
split: handle large numbers better

Prefer signed types to uintmax_t, as this allows for better
runtime checking with gcc -fsanitize=undefined.
Also, when an integer overflows just use the maximal value
when the code will do the right thing anyway.
* src/split.c (set_suffix_length, bytes_split, lines_split)
(line_bytes_split, lines_chunk_split, bytes_chunk_extract)
(lines_rr, parse_chunk, main):
Prefer a signed type (typically intmax_t) to uintmax_t.
(strtoint_die): New function.
(OVERFLOW_OK): New macro.  Use it elsewhere, where we now allow
LONGINT_OVERFLOW because the code then does the right thing on all
practical platforms (they have int wide enough so that it cannot
be practically exhausted).  We can do this now that we can safely
assume intmax_t has at least 64 bits.
(parse_n_units): New function.
(parse_chunk, main): Use it.
(main): Do not worry about integer overflow when the code
will do the right thing anyway with the extreme value.
Just use the extreme value.
* tests/split/fail.sh: Adjust to match new behavior.

2 years agosplit: prefer ssize_t for read result
Paul Eggert [Sat, 4 Mar 2023 19:42:16 +0000 (11:42 -0800)] 
split: prefer ssize_t for read result

* src/split.c (bytes_split, lines_chunk_split)
(bytes_chunk_extract, main): Prefer ssize_t to size_t when
representing the return value of ‘read’.  Use a negative value
instead of SIZE_MAX to indicate a missing value.

2 years agosplit: be more careful about buffer sizes
Paul Eggert [Sat, 4 Mar 2023 19:42:16 +0000 (11:42 -0800)] 
split: be more careful about buffer sizes

* src/split.c: Include sys-limits.h, not safe-read.h.
(input_file_size, bytes_split, lines_split, line_bytes_split)
(lines_chunk_split, bytes_chunk_extract, lines_rr): Call read, not
safe_read, since safe_read no longer buys us anything.
(main): Reject outlandish buffer sizes right away,
rather than allocating huge buffers and never using them.

2 years agosplit: minor -1 / 0 refactor
Paul Eggert [Sat, 4 Mar 2023 19:42:16 +0000 (11:42 -0800)] 
split: minor -1 / 0 refactor

* src/split.c (create, bytes_split, ofile_open):
Prefer comparing to 0 to comparing to -1.

2 years agosplit: don’t worry about ECHILD
Paul Eggert [Sat, 4 Mar 2023 19:42:16 +0000 (11:42 -0800)] 
split: don’t worry about ECHILD

* src/split.c (closeout): There should be no need for a special
case for ECHILD, since we never wait for the same child twice.
Simplify with this in mind.

2 years agosplit: don’t assume pid_t fits in int
Paul Eggert [Sat, 4 Mar 2023 19:42:16 +0000 (11:42 -0800)] 
split: don’t assume pid_t fits in int

* src/split.c (filter_pid): Now pid_t, not int.
(of_t): opid member is now pid_t, not int.

2 years agosplit: simplify SIGPIPE handling
Paul Eggert [Sat, 4 Mar 2023 19:42:16 +0000 (11:42 -0800)] 
split: simplify SIGPIPE handling

Ignore and default SIGPIPE, rather than blocking and unblocking it.
* src/split.c (default_SIGPIPE):
New static var, replacing oldblocked and newblocked.
(create): Use it.
(main): Set it.

2 years agosplit: port ‘split -n N /dev/null’ better to macOS
Paul Eggert [Sat, 4 Mar 2023 19:42:16 +0000 (11:42 -0800)] 
split: port ‘split -n N /dev/null’ better to macOS

* src/split.c (input_file_size): Do not bother with lseek if the
initial read probe reaches EOF, since the file size is known then.
This works better on macOS, which doesn’t allow lseek on /dev/null.
Do not special-case size-zero files, as the issue can occur
with any size file (though /proc files are the most common).
If the current position is past end of file, treat this as
size zero regardless of whether the file has a usable st_size.
Pass through lseek -1 return values rather than using ‘return -1’;
this makes the code a bit easier to analyze (and a bit faster).
Avoid undefined behavior if the size calculation overflows.
(lines_chunk_split): Do not bother with lseek if it would have
no effect if successful.  This works better on macOS, which
doesn’t allow lseek on /dev/null.
* tests/split/l-chunk.sh: Adjust to match fixed behavior.

2 years agomaint: fix NEWS quoting
Paul Eggert [Sat, 4 Mar 2023 19:42:16 +0000 (11:42 -0800)] 
maint: fix NEWS quoting

* NEWS: Use English-language quoting in recent news.

2 years agosplit: split more evenly with -n
Paul Eggert [Sat, 4 Mar 2023 19:41:03 +0000 (11:41 -0800)] 
split: split more evenly with -n

* src/split.c (bytes_split): New arg REM_BYTES.
Use this to split more evenly.  All callers changed.
(lines_chunk_split, bytes_chunk_extract):
Be consistent with new byte_split.
* tests/split/b-chunk.sh, tests/split/l-chunk.sh: Test new behavior.

2 years agosplit: small -n lines simplification
Paul Eggert [Sat, 4 Mar 2023 19:41:02 +0000 (11:41 -0800)] 
split: small -n lines simplification

* src/split.c (lines_chunk_split):
Rewrite while as if-while for clarity.

2 years agosplit: refactor lines_chunk_split
Paul Eggert [Sat, 4 Mar 2023 19:41:02 +0000 (11:41 -0800)] 
split: refactor lines_chunk_split

* src/split.c (lines_chunk_split): Simplify by having chunk_end
point to the first byte after the chunk, rather than to the last
byte of the chunk.  This will reduce confusion once we allow
chunks to be empty.

2 years agotee: tune when later -p overrides earlier
Paul Eggert [Sat, 4 Mar 2023 20:18:18 +0000 (12:18 -0800)] 
tee: tune when later -p overrides earlier

* src/tee.c (pipe_check): Make this a local var instead
of a static var.  This suppresses a -Wmaybe-uninitialized
diagnostic with gcc 12.2.1 20221121 (Red Hat 12.2.1-4).
(main): Don’t set pipe_check unnecessarily if a later
-p option overrides an earlier one that wants pipe_check.
Problem discovered when I investigated the GCC warning.

2 years agomaint: refactor tail.c to use iopoll
Pádraig Brady [Tue, 28 Feb 2023 18:36:02 +0000 (18:36 +0000)] 
maint: refactor tail.c to use iopoll

* src/tail.c (check_output_alive): Reuse iopoll()
rather than directly calling poll() or select().
* src/iopoll.c (iopoll): Refactor to support non blocking operation,
or ignoring descriptors by passing a negative value.
* src/iopoll.h (iopoll): Adjust to support a BLOCK parameter.
* src/tee.c (tee_files): Adjust iopoll() call to explicitly block.
* src/local.mk: Have tail depend on iopoll.c.

2 years agotail: avoid undefined behavior when polling outputs
Pádraig Brady [Tue, 28 Feb 2023 13:34:31 +0000 (13:34 +0000)] 
tail: avoid undefined behavior when polling outputs

* src/tail.c (check_output_alive): Only check the returned
events from poll() when it indicates there are events to check.

2 years agodoc: tee -p: clarify operation
Pádraig Brady [Mon, 27 Feb 2023 18:07:06 +0000 (18:07 +0000)] 
doc: tee -p: clarify operation

* src/tee.c (usage): Change from describing one (non pipe) aspect
to the more general point of being the option to use if working with
pipes, and referencing the more detailed info below.
* doc/coreutils.texi (tee invocation): s/standard/appropriate/ since
the standard operation with pipes is to exit immediately upon write
error.  s/early/immediately/ as it's ambiguous as to what "early"
is in relation to.

2 years agotests: tee -p: add test for early exit with closed pipes
Pádraig Brady [Tue, 3 Jan 2023 17:06:45 +0000 (18:06 +0100)] 
tests: tee -p: add test for early exit with closed pipes

* tests/misc/tee.sh: Add a test for the new iopoll logic
to detect closed outputs and exit early without needing
further input.

2 years agotee: enhance -p mode using iopoll() to detect broken pipe outputs
Carl Edquist [Thu, 15 Dec 2022 18:32:49 +0000 (12:32 -0600)] 
tee: enhance -p mode using iopoll() to detect broken pipe outputs

If input is intermittent (a tty, pipe, or socket), and all remaining
outputs are pipes (eg, >(cmd) process substitutions), exit early when
they have all become broken pipes (and thus future writes will fail),
without waiting for more input to become available, as future write
attempts to these outputs will fail (SIGPIPE/EPIPE).

Only provide this enhancement when pipe errors are ignored (-p mode).

Note that only one output needs to be monitored at a time with iopoll(),
as we only want to exit early if _all_ outputs have been removed.

* src/tee.c (pipe_check): New global for iopoll mode.
(main): enable pipe_check for -p, as long as output_error ignores EPIPE,
and input is suitable for iopoll().
(get_next_out): Helper function for finding next valid output.
(fail_output, tee_files): Break out write failure/output removal logic
to helper function.
(tee_files): Add out_pollable array to track which outputs are suitable
for iopoll() (ie, that are pipes); track first output index that is
still valid; add iopoll() broken pipe detection before calling read(),
removing an output that becomes a broken pipe.
* src/local.mk (src_tee_SOURCES): include src/iopoll.c.
* NEWS: Mention tee -p enhancement in Improvements.
* doc/coreutils.texi: Mention the new early exit behavior in the nopipe
modes for the tee -p option.

Suggested-by: Arsen Arsenović <arsen@aarsen.me>
2 years agoall: add broken pipe detection while waiting for input
Carl Edquist [Thu, 15 Dec 2022 12:10:33 +0000 (06:10 -0600)] 
all: add broken pipe detection while waiting for input

When a program's output becomes a broken pipe, future attempts to write
to that ouput will fail (SIGPIPE/EPIPE).  Once it is known that all
future write attepts will fail (due to broken pipes), in many cases it
becomes pointless to wait for further input for slow devices like ttys.
Ideally, a program could use this information to exit early once it is
known that future writes will fail.

Introduce iopoll() to wait on a pair of fds (input & output) for input
to become ready or output to become a broken pipe.

This is relevant when input is intermittent (a tty, pipe, or socket);
but if input is always ready (a regular file or block device), then
a read() will not block, and write failures for a broken pipe will
happen normally.

Introduce iopoll_input_ok() to check whether an input fd is relevant
for iopoll().

Experimentally, broken pipes are only detectable immediately for pipes,
but not sockets.  Errors for other file types will be detected in the
usual way, on write failure.

Introduce iopoll_output_ok() to check whether an output fd is suitable
for iopoll() -- namely, whether it is a pipe.

iopoll() is best implemented with a native poll(2) where possible, but
fall back to a select(2)-based implementation platforms where there are
portability issues.  See also discussion in tail.c.

In general, adding a call to iopoll() before a read() in filter programs
also allows broken pipes to "propagate" backwards in a shell pipeline.

* src/iopoll.c, src/iopoll.h (iopoll): New function implementing broken
pipe detection on output while waiting for input.
(IOPOLL_BROKEN_OUTPUT, IOPOLL_ERROR): Return codes for iopoll().
(IOPOLL_USES_POLL): Macro for poll() vs select() implementation.
(iopoll_input_ok): New function to check whether an input fd is relevant
for iopoll().
(iopoll_output_ok): New function to check whether an input fd is
suitable for iopoll().
* src/local.mk (noinst_HEADERS): add src/iopoll.h.

2 years agobuild: update to latest gnulib
Pádraig Brady [Mon, 27 Feb 2023 12:00:24 +0000 (12:00 +0000)] 
build: update to latest gnulib

* NEWS: Mention the fts fix to avoid the following assert
in rm on mem pressure:
  Program terminated with signal SIGSEGV, Segmentation fault.
    at ../lib/cycle-check.c:60
    assure (state->magic == CC_MAGIC);
* gnulib: Update to the latest to pick up fts commit f17d3977.

2 years agotests: avoid hang in new test
Pádraig Brady [Sun, 26 Feb 2023 18:10:41 +0000 (18:10 +0000)] 
tests: avoid hang in new test

* tests/rm/empty-inacc.sh: Ensure we're not reading from stdin
when we're relying on no prompt to proceed.  Also change the
file being tested so that a failure in one test doesn't impact
following tests causing a framework failure.

2 years agotests: avoid gdb on macOS
Pádraig Brady [Fri, 24 Feb 2023 15:40:37 +0000 (15:40 +0000)] 
tests: avoid gdb on macOS

gdb was seen to hang intermittently on macOS 12.
Also gdb requires signing on newer macOS systems:
https://sourceware.org/gdb/wiki/PermissionsDarwin
So restrict its use on macOS systems for now.

* tests/rm/r-root.sh: Skip on darwin systems.
* tests/tail-2/inotify-race.sh: Restrict the test to
inotify capable systems to avoid the hang with some gdbs.
* tests/tail-2/inotify-race.sh: Likewise.

2 years agocp,install,mv: --debug: output debug info when reflinking
Pádraig Brady [Fri, 24 Feb 2023 15:15:20 +0000 (15:15 +0000)] 
cp,install,mv: --debug: output debug info when reflinking

* src/copy.c (copy_reg): Always check whether to output debug info.
(emit_debug): Restrict output with `cp --attributes-only`.

2 years agotests: determine if SEEK_HOLE is enabled
Pádraig Brady [Thu, 23 Feb 2023 20:28:51 +0000 (20:28 +0000)] 
tests: determine if SEEK_HOLE is enabled

Upcomming gnulib changes may disable SEEK_HOLE
even if the system supports it, so dynamically
check if we've SEEK_HOLE enabled.

* init.cfg (seek_data_capable_): SEEK_DATA may be disabled in the build
if the system support is deemed insufficient, so also use `cp --debug`
to determine if it's enabled.
* tests/cp/sparse-2.sh: Adjust to a more general diagnostic.
* tests/cp/sparse-extents-2.sh: Likewise.
* tests/cp/sparse-extents.sh: Likewise.
* tests/cp/sparse-perf.sh: Likewise.

2 years agocp,install,mv: add --debug to explain how a file is copied
Pádraig Brady [Fri, 17 Feb 2023 13:46:13 +0000 (13:46 +0000)] 
cp,install,mv: add --debug to explain how a file is copied

How a file is copied is dependent on the sparseness of the file,
what file system it is on, what file system the destination is on,
the attributes of the file, and whether they're being copied or not.
Also the --reflink and --sparse options directly impact the operation.

Given it's hard to reason about the combination of all of the above,
the --debug option is useful for users to directly identify if
copy offloading, reflinking, or sparse detection are being used.

It will also be useful for tests to directly query if
these operations are supported.

The new output looks as follows:

  $ src/cp --debug src/cp file.sparse
  'src/cp' -> 'file.sparse'
  copy offload: yes, reflink: unsupported, sparse detection: no

  $ truncate -s+1M file.sparse

  $ src/cp --debug file.sparse file.sparse.cp
  'file.sparse' -> 'file.sparse.cp'
  copy offload: yes, reflink: unsupported, sparse detection: SEEK_HOLE

  $ src/cp --reflink=never --debug file.sparse file.sparse.cp
  'file.sparse' -> 'file.sparse.cp'
  copy offload: avoided, reflink: no, sparse detection: SEEK_HOLE

* doc/coreutils.texi (cp invocation): Describe the --debug option.
(mv invocation): Likewise.
(install invocation): Likewise.
* src/copy.h: Add a new DEBUG member to cp_options, to control
whether to output debug info or not.
* src/copy.c (copy_debug): A new global structure to
unconditionally store debug into from the last copy_reg operations.
(copy_debug_string, emit_debug): New functions to print debug info.
* src/cp.c: if ("--debug") x->debug=true;
* src/install.c: Likewise.
* src/mv.c: Likewise.
* tests/cp/debug.sh: Add a new test.
* tests/local.mk: Reference the new test.
* NEWS: Mention the new feature.

2 years agobuild: update gnulib submodule to latest
Paul Eggert [Thu, 23 Feb 2023 19:18:32 +0000 (11:18 -0800)] 
build: update gnulib submodule to latest

2 years agodoc: chgrp,chmod,chown: state --reference always dereferences
Pádraig Brady [Thu, 23 Feb 2023 15:22:14 +0000 (15:22 +0000)] 
doc: chgrp,chmod,chown: state --reference always dereferences

* src/chgrp.c (usage): State that --reference always
dereferences symbolic links.
* src/chmod.c (usage): Likewise.
* src/chown.c (usage): Likewise.
Fixes https://bugs.gnu.org/61720

2 years agodoc: fix some spelling mistakes
ChuanGang Jiang [Tue, 21 Feb 2023 14:18:52 +0000 (14:18 +0000)] 
doc: fix some spelling mistakes

* doc/coreutils.texi: s/functionalty/functionality/,
   s/sychronize/synchronize/, s/millsecond/millisecond/
   s/paramter/parameters/
* init.cfg: s/parmeters/parameters/
* scripts/build-older-versions/README.older-versions: s/vesion/version/
* tests/misc/env-S-script.sh: s/paramaters/parameters/
Fixes https://bugs.gnu.org/61681

2 years agomaint: avoid -Wmaybe-uninitialized warning from GCC13
Pádraig Brady [Tue, 21 Feb 2023 16:14:44 +0000 (16:14 +0000)] 
maint: avoid -Wmaybe-uninitialized warning from GCC13

* src/copy.c (infer_scantype): Always set scan_inference.ext_start,
as per commit 6c03e8fb which was inadvertently reverted by d374d32c.

2 years agotests: initialize a variable
Jim Meyering [Mon, 20 Feb 2023 16:37:18 +0000 (08:37 -0800)] 
tests: initialize a variable

* tests/rm/interactive-once.sh (write_prot_msg1): Initialize it,
so an envvar setting cannot perturb the test.

2 years agorm: --dir (-d): fix bugs in handling of empty, inaccessible directories
Jim Meyering [Mon, 6 Feb 2023 17:01:55 +0000 (09:01 -0800)] 
rm: --dir (-d): fix bugs in handling of empty, inaccessible directories

* src/remove.c (prompt, rm_fts): In the dir-handling code of both of
these functions, relax a "get_dir_status (...) == DS_EMPTY" condition
to instead test only "get_dir_status (...) != 0", enabling flow control
to reach the prompt function also for unreadable directories. However,
that function itself also needed special handling for this case:
(prompt): Handle empty, inaccessible directories properly,
deleting them with -d (--dir), and prompting about whether to delete
with -i (--interactive).
* tests/rm/empty-inacc.sh: Add tests for the new code.
Reported by наб <nabijaczleweli@nabijaczleweli.xyz> in
bugs.debian.org/1015273
* NEWS (Bug fixes): Mention this.

2 years agotests: port chmod/setgid.sh to macOS 12
Paul Eggert [Sat, 18 Feb 2023 21:29:41 +0000 (13:29 -0800)] 
tests: port chmod/setgid.sh to macOS 12

* tests/chmod/setgid.sh: Try all the groups you’re a member of,
in case id -g returns 4294967295 (nogroup) which is special
and does not let you chgrp a file to it.

2 years agotests: port better to macOS group numbers
Paul Eggert [Sat, 18 Feb 2023 21:27:45 +0000 (13:27 -0800)] 
tests: port better to macOS group numbers

* init.cfg (groups): Port better to macOS 12, where
group 4294967295 (nogroup) is special: you can be a member
without being able to chgrp files to the group.

2 years agobuild: update gnulib submodule to latest
Paul Eggert [Sat, 18 Feb 2023 20:02:11 +0000 (12:02 -0800)] 
build: update gnulib submodule to latest

2 years agocp: fclonefileat security fix + CLONE_ACL + fixups
Paul Eggert [Fri, 10 Feb 2023 21:34:54 +0000 (13:34 -0800)] 
cp: fclonefileat security fix + CLONE_ACL + fixups

* src/copy.c: Some changes if HAVE_FCLONEFILEAT && !USE_XATTR.
(fd_has_acl): New function.
(CLONE_ACL): Default to 0.
(copy_reg): Use CLONE_NOFOLLOW to avoid races like CVE-2021-30995
<https://www.trendmicro.com/en_us/research/22/a/
analyzing-an-old-bug-and-discovering-cve-2021-30995-.html>.
Use CLONE_ACL if available and working, falling back to cloning
without it if it fails due to EINVAL.
If the only problem with fclonefileat is that it would create the
file with the wrong timestamp, or with too few permissions,
do that but fix the timestamp and permissions afterwards,
rather than falling back on a traditional copy.

2 years agomaint: fix some typos in comments
ChuanGang Jiang [Fri, 10 Feb 2023 15:41:33 +0000 (15:41 +0000)] 
maint: fix some typos in comments

* NEWS: s/commmand/command/
* cfg.mk: Adjust old_NEWS_hash with `make update-NEWS-hash`.
* src/expand-common.c: s/specifed/specified/
* src/pr.c: s/e.g/e.g./
* tests/misc/comm.pl: s/ouput/output/
Fixes https://bugs.gnu.org/61405

2 years agocp: simplify infer_scantype
Paul Eggert [Fri, 10 Feb 2023 03:10:47 +0000 (19:10 -0800)] 
cp: simplify infer_scantype

* src/copy.c (infer_scantype): Do not set *SCAN_INFERENCE
when returning a value other than LSEEK_SCANTYPE.
This is just minor refactoring; it simplifies the code a bit.
Callers are uneffected.

doc: document --preserve=mode better

2 years agotail: improve --follow=name with single non regular files
Pádraig Brady [Wed, 1 Feb 2023 20:41:31 +0000 (20:41 +0000)] 
tail: improve --follow=name with single non regular files

* src/tail (tail_forever): Attempt to read() from non blocking
single non regular file, which shouldn't block, but also
read data even when the mtime doesn't change.
* NEWS: Mention the improvement.
* THANKS.in: Thanks for detailed testing.

2 years agotail: fix support for -F with non seekable files
Pádraig Brady [Mon, 30 Jan 2023 21:44:10 +0000 (21:44 +0000)] 
tail: fix support for -F with non seekable files

This was seen to be an issue when following a
symlink that was being updated to point to
different underlying devices.

* src/tail.c (recheck): Guard the lseek() call to only
be performed for regular files.
* NEWS: Mention the bug fix.

2 years agocksum: add --raw option to output a binary digest
Pádraig Brady [Fri, 3 Feb 2023 16:34:18 +0000 (16:34 +0000)] 
cksum: add --raw option to output a binary digest

--raw output is the most composable format, and also is a
robust way to discard the file name without parsing (escaped) output.

Examples:

  $ cksum --raw -a crc "$afile" | basenc --base16
  4ACFC4F0

  $ cksum --raw -a crc "$afile" | basenc --base2msbf
  01001010110011111100010011110000

  $ cksum --raw -a sha256 "$bfile" | basenc --base32
  AAAAAAAADHLGRHAILLQWLAY6SNH7OY5OI2RKNQLSWPY3MCUM4JXQ====

* doc/coreutils.texi (cksum invocation): Describe the new feature.
* src/digest.c (output_file): Inspect the new RAW_DIGEST global,
and output the bytes directly if set.
* src/cksum.c (output_crc): Likewise.
* src/sum.c (output_bsd, output_sysv): Likewise.
* tests/misc/cksum-raw.sh: A new test.
* tests/local.mk: Reference the new test.
* NEWS: Mention the new feature.

2 years agobuild: uptime: avoid issues on systems without utmp.h
Pádraig Brady [Sun, 5 Feb 2023 13:51:20 +0000 (13:51 +0000)] 
build: uptime: avoid issues on systems without utmp.h

* src/uptime.c (print_uptime): Following gnulib commit 9041103
HAVE_UTMP_H will always be defined.  Therefore key on whether
the utmp.ut_type member is present.
* boottime.m4 (GNULIB_BOOT_TIME): Assume utmp.h is present.

2 years agomaint: use alignasof, not stdalign
Paul Eggert [Sat, 4 Feb 2023 22:42:21 +0000 (14:42 -0800)] 
maint: use alignasof, not stdalign

* .gitignore: Update accordingly.
* bootstrap.conf (gnulib_modules): Replace obsolescent stdalign
with alignasof.
* gl/modules/randread (Depends-on): Depend on alignasof, not stdalign.

2 years agomaint: prefer https: to git:
Paul Eggert [Sat, 4 Feb 2023 19:53:50 +0000 (11:53 -0800)] 
maint: prefer https: to git:

The idea is to defend against some adversary-in-the-middle attacks.

2 years agobuild: update gnulib submodule to latest
Paul Eggert [Sat, 4 Feb 2023 18:16:06 +0000 (10:16 -0800)] 
build: update gnulib submodule to latest

2 years agomaint: avoid line length syntax check failure
Pádraig Brady [Fri, 3 Feb 2023 16:42:01 +0000 (16:42 +0000)] 
maint: avoid line length syntax check failure

* src/cp.c: Adjust source line to be <= 80 chars.

2 years agotests: fix exit status check in cp -u test
Pádraig Brady [Fri, 3 Feb 2023 16:37:26 +0000 (16:37 +0000)] 
tests: fix exit status check in cp -u test

* tests/cp/preserve-link.sh: This should have been part
of commit v9.1-134-g01503ce73.

2 years agocksum: accept new option: --base64 (-b)
Jim Meyering [Sat, 21 Jan 2023 02:09:26 +0000 (18:09 -0800)] 
cksum: accept new option: --base64 (-b)

* src/digest.c [HASH_ALGO_CKSUM]: Include "base64.h"
[HASH_ALGO_CKSUM] (base64_digest): New global.
[HASH_ALGO_CKSUM] (enum BASE64_DIGEST_OPTION): New enum.
[HASH_ALGO_CKSUM] (long_options): Add "base64".
(valid_digits): Rename from hex_digits, now taking an input length argument.
Adjust callers.
(bsd_split_3): Rename arg from hex_digits to digest.
Add new *d_len parameter for length of extracted digest.
Move "i" declaration down to first use.
(split_3): Rename arg from hex_digits to digest.
Add new *d_len parameter for length of extracted digest.
Instead of relying on "known" length of digest to find the following
must-be-whitespace byte, search for the first whitespace byte.
[HASH_ALGO_CKSUM] (output_file): Handle base64_digest.
[HASH_ALGO_CKSUM] (main): Set base64_digest.
[HASH_ALGO_CKSUM] (b64_equal): New function.
(hex_equal): New function, factored out of digest_check.
(digest_check) Factored part into b64_equal and hex_equal.
Rename local hex_digest to digest.
* tests/misc/cksum-base64.pl: Add tests.
* tests/local.mk (all_tests): Add to the list.
* cfg.mk (_cksum): Define.
(exclude_file_name_regexp--sc_prohibit_test_backticks): Exempt new test.
(exclude_file_name_regexp--sc_long_lines): Likewise.
* doc/coreutils.texi (cksum invocation): Document it.
(md5sum invocation) [--check]: Mention digest encoding auto-detect.
* NEWS (New Features): Mention this.

2 years agodoc: document --preserve=mode better
Paul Eggert [Tue, 31 Jan 2023 21:52:39 +0000 (13:52 -0800)] 
doc: document --preserve=mode better

* doc/coreutils.texi: Spruce up cp --preserve=mode doc.

2 years agocp: improve --preserve usage doc
Paul Eggert [Tue, 31 Jan 2023 18:39:43 +0000 (10:39 -0800)] 
cp: improve --preserve usage doc

* src/cp.c (usage): Improve description of --preserve.

2 years agocp,mv: skipping due to -u is success, not failure
Paul Eggert [Tue, 31 Jan 2023 17:24:43 +0000 (09:24 -0800)] 
cp,mv: skipping due to -u is success, not failure

This reverts the previous change, so that when a file
is skipped due to -u, this is not considered a failure.
* doc/coreutils.texi: Document this.
* src/copy.c (copy_internal): If --update says to skip,
treat this as success instead of failure.
* tests/mv/update.sh, tests/cp/slink-2-slink.sh:
Revert previous change, to match reverted behavior.

2 years agocp,ln,mv: when skipping exit with nonzero status
Paul Eggert [Tue, 31 Jan 2023 16:46:21 +0000 (08:46 -0800)] 
cp,ln,mv: when skipping exit with nonzero status

* NEWS, doc/coreutils.texi: Document this.
* src/copy.c (copy_internal):
* src/ln.c (do_link): Return false when skipping action due to
--interactive or --no-clobber.
* tests/cp/cp-i.sh, tests/cp/preserve-link.sh:
* tests/cp/slink-2-slink.sh, tests/mv/i-1.pl, tests/mv/i-5.sh:
* tests/mv/mv-n.sh, tests/mv/update.sh:
Adjust expectations of exit status to match revised behavior.

2 years agotests: cksum: fix test to include more cases
Pádraig Brady [Mon, 30 Jan 2023 19:29:38 +0000 (19:29 +0000)] 
tests: cksum: fix test to include more cases

* tests/misc/cksum-c.sh: Fix typo which caused part
of the test data to be ignored.

2 years agodigest.c: remove a duplicate variable
Jim Meyering [Mon, 30 Jan 2023 16:33:10 +0000 (08:33 -0800)] 
digest.c: remove a duplicate variable

* src/digest.c (digest_check): Locals n_misformatted_lines and
n_improperly_formatted_lines were declared and set/incremented
identically. Remove declaration of the latter. Use the other instead.

2 years agobuild: avoid spurious failures due to lack of EGREP definition
Jim Meyering [Sat, 21 Jan 2023 01:54:28 +0000 (17:54 -0800)] 
build: avoid spurious failures due to lack of EGREP definition

* configure.ac: Use AC_PROG_EGREP, since many doc and test rules
use $EGREP.
* cfg.mk (sc_tests_list_consistency): Use grep -E, not $(EGREP) here.

2 years agotests: ensure we fail if mv --no-copy crashes
Pádraig Brady [Fri, 27 Jan 2023 19:46:52 +0000 (19:46 +0000)] 
tests: ensure we fail if mv --no-copy crashes

* tests/mv/no-copy.sh: Honor `make syntax` check
and use the `returns_ 1 ...` pattern.

2 years agomv: new option --no-copy
Paul Eggert [Fri, 27 Jan 2023 18:59:13 +0000 (10:59 -0800)] 
mv: new option --no-copy

Wishlist item from Mike Frysinger (Bug#61050).
* src/copy.c (copy_internal):
Do not fall back on copying if x->no_copy.
* src/copy.h (struct cp_options): New member no_copy.
* src/mv.c (NO_COPY_OPTION): New constant.
(long_options, usage, main): Support --no-copy.
* tests/mv/no-copy.sh: New test.
* tests/local.mk (all_tests): Add it.

2 years agomaint: add lib/error.h to .gitignore
Pádraig Brady [Tue, 17 Jan 2023 22:38:40 +0000 (22:38 +0000)] 
maint: add lib/error.h to .gitignore

* .gitignore: Add /lib/error.h as suggested by sc_gitignore_missing
as a result of gnulib change 2886cca8.

2 years agodoc: csplit: more accurate --elide-empty-files help
Pádraig Brady [Tue, 17 Jan 2023 21:31:31 +0000 (21:31 +0000)] 
doc: csplit: more accurate --elide-empty-files help

* src/csplit.c (usage): Use "suppress" rather than "remove"
when describing -z so it's more apparent that the effect
is a particular numbered file is not created, rather than
being removed later.  I.e., don't suggest -z may induce
gaps in file numbering.
Reported at https://bugs.debian.org/1029103

2 years agobuild: update gnulib submodule to latest
Paul Eggert [Sat, 14 Jan 2023 01:33:58 +0000 (17:33 -0800)] 
build: update gnulib submodule to latest

* m4/xattr.m4: Remove.  This file is now autogenerated by 'bootstrap',
since it's now in Gnulib.  (I did this part by hand.)

2 years agocopy: copy_file_range: handle ENOENT for CIFS
Pádraig Brady [Sat, 7 Jan 2023 16:10:01 +0000 (16:10 +0000)] 
copy: copy_file_range: handle ENOENT for CIFS

* src/copy.c (sparse_copy): Fallback to standard copy upon ENOENT,
which was seen intermittently across CIFS file systems.
* NEWS: Mention the bug fix, though qualify it as an "issue"
rather than a bug, as coreutils is likely only highlighting
a CIFS bug in this case.
Fixes https://bugs.gnu.org/60455

2 years agomaint: update .gitignore
Paul Eggert [Sat, 7 Jan 2023 23:50:27 +0000 (15:50 -0800)] 
maint: update .gitignore

* .gitignore: Add confdefs*, conftest* (temporaries built
by ‘configure’).

2 years agomaint: adjust to Gnulib macro renaming
Paul Eggert [Sat, 7 Jan 2023 23:49:48 +0000 (15:49 -0800)] 
maint: adjust to Gnulib macro renaming

* src/local.mk (LDADD, copy_ldadd, remove_ldadd, src_sort_LDADD)
(src_test_LDADD, copy_ldadd, src_date_LDADD, src_ginstall_LDADD)
(src_ln_LDADD, src_ls_LDADD, src_mktemp_LDADD, src_pr_LDADD)
(src_tac_LDADD, src_touch_LDADD, src_dd_LDADD, src_sleep_LDADD)
(src_sort_LDADD, src_tail_LDADD, src_sort_LDADD, LDADD):
Adjust to recent Gnulib changes.

2 years agobuild: update gnulib submodule to latest
Paul Eggert [Sat, 7 Jan 2023 23:34:31 +0000 (15:34 -0800)] 
build: update gnulib submodule to latest

2 years agocopy: immediately fail with transient reflink errors
Pádraig Brady [Mon, 2 Jan 2023 13:07:41 +0000 (13:07 +0000)] 
copy: immediately fail with transient reflink errors

* src/copy.c (handle_clone_fail): A new function refactored
from copy_reg() to handle failures from FICLONE or fclonefileat().
Fail with all errors from FICLONE, unless they're from the set
indicating the file system or file do not support the clone operation.
Also fail with errors from fclonefileat() (dest_dest < 0)
if they're from the set indicating a transient failure for the file.
(copy_ref): Call handle_clone_fail() after fclonefileat() and FICLONE.
(sparse_copy): Call the refactored is_CLONENOTSUP()
which is now also used by the new handle_clone_fail() function.
* NEWS: Mention the bug fix.  Also mention explicitly
the older --reflink=auto default change to aid searching.
* cfg.mk: Adjust old_NEWS_hash with `make update-NEWS-hash`.
Fixes https://bugs.gnu.org/60489

2 years agoall: further adjustments for new Ronna, Quetta SI prefixes
Pádraig Brady [Fri, 6 Jan 2023 13:13:54 +0000 (13:13 +0000)] 
all: further adjustments for new Ronna, Quetta SI prefixes

* src/dd.c (parse_integer): Support Q,R suffixes.
* src/od.c (main): Likewise.
* src/split.c (main): Likewise.
* src/stdbuf.c (parse_size): Likewise.
* src/truncate.c (main): Likewise.
* src/sort.c (specify_size_size): Likewise.
Also line length syntax check fix.
* tests/misc/numfmt.pl: Adust top end large number checks
to the new largest values.
* doc/coreutils.texi (numfmt invocation): Add a numfmt example.
* NEWS: Tweak to aid searchability.

2 years agonumfmt: add support for new SI prefixes
Paul Eggert [Thu, 5 Jan 2023 19:42:51 +0000 (11:42 -0800)] 
numfmt: add support for new SI prefixes

* src/dd, src/head.c, src/od.c, src/sort.c, src/stdbuf.c, src/tail.c:
(usage):
* src/system.h (emit_size_note):
Mention new SI prefixes.
* src/du.c (main):
* src/head.c (head_file):
* src/numfmt.c (suffix_power, suffix_power_char, prepare_padded_number):
* src/shred.c (main):
* src/sort.c (unit_order):
* src/tail.c (parse_options):
Support new SI prefixes.
* src/numfmt.c (MAX_ACCEPTABLE_DIGITS): Increase to 33.
(zero_and_valid_suffixes, valid_suffixes): New constants,
with new SI prefixes.
(valid_suffix, unit_to_umax): Use them.
(prepare_padded_number): Diagnose "999Q" instead of "999Y".
* tests/misc/numfmt.pl, tests/misc/sort.pl:
Adjust tests to match new max.

2 years agols: adjust to Gnulib renaming
Paul Eggert [Thu, 5 Jan 2023 19:42:51 +0000 (11:42 -0800)] 
ls: adjust to Gnulib renaming

* src/local.mk (src_ls_LDADD): In Gnulib,
LIB_HAS_ACL was renamed to FILE_HAS_ACL_LIB.

2 years agobuild: update gnulib submodule to latest
Paul Eggert [Thu, 5 Jan 2023 19:42:51 +0000 (11:42 -0800)] 
build: update gnulib submodule to latest

2 years agomaint: avoid grep warning in sc_prohibit_test_minus_ao
Bernhard Voelker [Tue, 3 Jan 2023 08:11:28 +0000 (09:11 +0100)] 
maint: avoid grep warning in sc_prohibit_test_minus_ao

Newer grep(1) complains:
  $ make sc_prohibit_test_minus_ao
  /usr/bin/grep: warning: * at start of expression
  prohibit_test_minus_ao

* cfg.mk (exclude_file_name_regexp--sc_prohibit_test_minus_ao): Fix
expression inroduced in v8.24-120-g3205bb178, and narrow down the file
pattern to the 'doc/' directory.

2 years agodoc: copy: mention the reinstated I/O size constraints
Pádraig Brady [Mon, 2 Jan 2023 23:16:07 +0000 (23:16 +0000)] 
doc: copy: mention the reinstated I/O size constraints

* NEWS: Mention the change in behavior re block size multiples
to support unusual devices with this constraint.
* src/copy.c (copy_reg): Likewise.

2 years agocopy: fix possible over allocation for regular files
Paul Eggert [Sun, 20 Nov 2022 03:04:36 +0000 (19:04 -0800)] 
copy: fix possible over allocation for regular files

* bootstrap.conf (gnulib_modules): Add count-leading-zeros,
which was already an indirect dependency, since ioblksize.h
now uses it directly.
* src/ioblksize.h: Include count-leading-zeros.h.
(io_blksize): Treat impossible blocksizes as IO_BUFSIZE.
When growing a blocksize to IO_BUFSIZE, keep it a multiple of the
stated blocksize.  Work around the ZFS performance bug.
* NEWS: Mention the bug fix.
Problem reported by Korn Andras at https://bugs.gnu.org/59382

2 years agomaint: update all copyright year number ranges
Pádraig Brady [Sun, 1 Jan 2023 14:50:15 +0000 (14:50 +0000)] 
maint: update all copyright year number ranges

Update to latest gnulib with new copyright year.
Run "make update-copyright" and then...

* tests/init.sh: Sync with gnulib to pick up copyright year.
* bootstrap: Manually update copyright year,
until we fully sync with gnulib at a later stage.
* tests/sample-test: Adjust to use the single most recent year.

2 years agobuild: update gnulib submodule to latest
Pádraig Brady [Sun, 1 Jan 2023 13:39:25 +0000 (13:39 +0000)] 
build: update gnulib submodule to latest

mainly to get updated copyright year

* tests/init.sh: Sync with gnulib

2 years agostty: fix off by one column wrapping on output
Pádraig Brady [Sat, 31 Dec 2022 17:03:39 +0000 (17:03 +0000)] 
stty: fix off by one column wrapping on output

* src/stty.c (wrapf): Adjust the comparison by 1,
to account for the space we're adding.
* tests/misc/stty.sh: Add a test case.
* NEWS: Mention the fix.
Reported in https://bugs.debian.org/1027442

2 years agocopy: attempt copy offload with sparse files by default
Pádraig Brady [Fri, 30 Dec 2022 19:34:27 +0000 (19:34 +0000)] 
copy: attempt copy offload with sparse files by default

This was seen to vastly improve performance
on NFS 4.2 systems by allowing server side copies,
with partially sparse files (avidemux generated mp4 files).

* src/copy.c (lseek_copy): Also set hole_size to 0,
i.e. enable copy_file_range(), with --sparse=auto (the default),
to enable copy offload in this case, as we've strong signal
from SEEK_DATA that we're operating on actual data and not holes here.
* NEWS: Mention the improvement.
Fixes https://bugs.gnu.org/60416

2 years agowc: fix regression determining file size
Pádraig Brady [Wed, 28 Dec 2022 14:04:19 +0000 (14:04 +0000)] 
wc: fix regression determining file size

* src/wc.c (wc): Use off_t rather than size_t
when calculating where to seek to, so that
we don't seek to a too low offset on systems
where size_t < off_t, which would result in
many read() calls to determine the file size.
* tests/misc/wc-proc.sh: Add a test case
sufficient for 32 bit systems at least.
* NEWS: Mention the bug fix.
Reported at https://bugs.debian.org/1027101

2 years agomaint: avoid recent syntax check failure
Pádraig Brady [Thu, 29 Dec 2022 14:14:11 +0000 (14:14 +0000)] 
maint: avoid recent syntax check failure

* tests/cp/proc-short-read.sh: Adjust so shorter lines.

2 years agodoc: improve doc of du with CoW etc
Paul Eggert [Mon, 26 Dec 2022 18:34:48 +0000 (10:34 -0800)] 
doc: improve doc of du with CoW etc

Problem reported by Krzysztof Żelechowski (Bug#60335).
* doc/coreutils.texi (du invocation): Reword.

2 years agodoc: improve du --threshold wording
Paul Eggert [Mon, 26 Dec 2022 17:39:16 +0000 (09:39 -0800)] 
doc: improve du --threshold wording

* doc/coreutils.texi (du invocation): Reword.

2 years agotests: accommodate bogomips capitalizations
Paul Eggert [Mon, 26 Dec 2022 17:01:37 +0000 (09:01 -0800)] 
tests: accommodate bogomips capitalizations

* tests/cp/proc-short-read.sh: Kernel on ARMv7 Processor rev 3 (v7l)
spells it "BogoMIPS", so allow any capitalization.  Patch from
Zach van Rijn in <https://bugs.gnu.org/60339>.

2 years agobuild: update gnulib submodule to latest
Paul Eggert [Tue, 6 Dec 2022 18:45:06 +0000 (10:45 -0800)] 
build: update gnulib submodule to latest

2 years agodoc: timezone -> time zone
Paul Eggert [Tue, 6 Dec 2022 18:40:28 +0000 (10:40 -0800)] 
doc: timezone -> time zone

2 years agodoc: improve date -I doc
Paul Eggert [Tue, 6 Dec 2022 02:42:19 +0000 (18:42 -0800)] 
doc: improve date -I doc

Suggested by Marc Chantreux (bug#59827).
* doc/coreutils.texi (Options for date):
Give formats for -I, like we already do for --rfc-3339.

2 years agobuild: fix missing inclusion of poll.h on macOS
Dennis Williamson [Mon, 5 Dec 2022 14:30:35 +0000 (14:30 +0000)] 
build: fix missing inclusion of poll.h on macOS

* src/tail.c: Following on from commit v9.1-55-g324c188cf
also include poll.h for __APPLE__, which was seen to be required
on macOS 11.6

2 years agodoc: tee: make -p decription more complete
Pádraig Brady [Mon, 28 Nov 2022 22:39:19 +0000 (22:39 +0000)] 
doc: tee: make -p decription more complete

* doc/coreutils.texi (tee invocation): Give a more
cohesive description of the -p option, and how
it differs from the default operation.

2 years agoscripts: commit-msg: recognize Git cut_lines
Arsen Arsenović [Sun, 20 Nov 2022 11:25:12 +0000 (12:25 +0100)] 
scripts: commit-msg: recognize Git cut_lines

This prevents spurious failures from happening when someone sets
commit.verbose or passes -v to commit.

2 years agodoc: more dash fixes
Paul Eggert [Tue, 15 Nov 2022 18:55:23 +0000 (10:55 -0800)] 
doc: more dash fixes

* doc/coreutils.texi, doc/sort-version.texi: Prefer on "x -- y" to
"x---y" in prose, as the result is more readable in Emacs.
Fix some instances of unescaped ‘-’ that should be minus, not
hyphen. Fix some other instances that should be en dash.  No
spaces around en dash when it’s a range.

2 years agomaint: fix cfg.mk comment
Paul Eggert [Tue, 15 Nov 2022 18:51:47 +0000 (10:51 -0800)] 
maint: fix cfg.mk comment

* cfg.mk (sc_texi_long_option_escaped): Fix comment.

2 years agotests: make SIGPIPE trap checking more robust
Pádraig Brady [Tue, 15 Nov 2022 13:57:47 +0000 (13:57 +0000)] 
tests: make SIGPIPE trap checking more robust

* init.cfg (trap_sigpipe_or_skip_): A subshell with ignored SIGPIPE
was seen to not terminate, on Solaris 11 at least.
So protect with a timeout(1).

2 years agomaint: avoid new grep -q syntax-check failures
Pádraig Brady [Tue, 15 Nov 2022 13:27:57 +0000 (13:27 +0000)] 
maint: avoid new grep -q syntax-check failures

* cfg.mk: Exclude NEWS from the check.
* init.cfg: s/grep -q/grep >/dev/null/.
* tests/ls/hyperlink.sh: Likewise.
* tests/ls/symlink-quote.sh: Likewise.

2 years agomaint: avoid misquoting of some --long-options in texi
Pádraig Brady [Tue, 15 Nov 2022 11:54:58 +0000 (11:54 +0000)] 
maint: avoid misquoting of some --long-options in texi

* cfg.mk (sc_texi_long_option_escaped): A new check to
avoid future instances of this.
* doc/coreutils.texi (Common options): Rearrange this menu
to be less repetitive in each description, and avoid long lines.
Addresses https://bugs.gnu.org/59262

2 years agodoc: fix markup
Paul Eggert [Tue, 15 Nov 2022 03:08:19 +0000 (19:08 -0800)] 
doc: fix markup

Problem reported by Antonio Diaz Diaz (bug#59262).
* doc/coreutils.texi: Use markup in menus to prevent
‘--’ from turning into an em dash, and to be more
consistent.

2 years agobuild: update gnulib submodule to latest
Paul Eggert [Tue, 15 Nov 2022 03:00:06 +0000 (19:00 -0800)] 
build: update gnulib submodule to latest

2 years agodoc: printf: make "java" encoding example more standard
Pádraig Brady [Fri, 28 Oct 2022 13:40:28 +0000 (14:40 +0100)] 
doc: printf: make "java" encoding example more standard

Note using iconv(1) rather than recode(1) is not appropriate
for this example, as the required functionality is only
available on libiconv's iconv implementation, which is
not installed on most systems.

* doc/coreutils.texi (printf invocation): Use env rather than
/usr/local/bin for the printf command.  Escape '%' so more robust.
Also use a locale that exists on modern systems.

2 years agodoc: move description of printf options to better location
Pádraig Brady [Thu, 27 Oct 2022 17:38:14 +0000 (18:38 +0100)] 
doc: move description of printf options to better location

* doc/coreutils.texi (printf invocation): Move the description
of accepted options from the middle of the unicode discussion.

2 years agoprintf: with \U, support all valid unicode points
Pádraig Brady [Thu, 27 Oct 2022 14:17:07 +0000 (15:17 +0100)] 
printf: with \U, support all valid unicode points

Previously this was restricted to the C99 universal character subset,
which restricted most values <= 0x9F, as that simplifies the C lexer.
However printf(1) doesn't need this restriction.
Note also the bash builtin printf already supports all values <= 0x9F.

* src/printf.c (main): Relax the restriction on points <= 0x9F.
* doc/coreutils.texi (printf invocation): Adjust description.
* tests/misc/printf-cov.pl: Adjust accordingly.  Add new cases.
* NEWS: Mention the change in behavior.
Reported at https://bugs.debian.org/1022857

2 years agodoc: basenc: reference from base{32,64} docs
Pádraig Brady [Wed, 26 Oct 2022 11:47:38 +0000 (12:47 +0100)] 
doc: basenc: reference from base{32,64} docs

* doc/coreutils.texi (base32 invocation): Reference basenc
to improve discoverability.
(base64 invocation): Likewise.
* man/base32.x: Likewise.
* man/base64.x: Likewise.

2 years agodoc: sort: mention --version useful for IPv4 addresses
Pádraig Brady [Fri, 30 Sep 2022 14:44:30 +0000 (15:44 +0100)] 
doc: sort: mention --version useful for IPv4 addresses

* doc/coreutils.texi (sort invocation): Mention in the
multi invocation sort example that the -V GNU extension
could be used to sort IPv4 addresses, and thus simplify
to a single invocation.

2 years agomaint: NEWS: use consistent quoting
Pádraig Brady [Wed, 28 Sep 2022 18:01:04 +0000 (19:01 +0100)] 
maint: NEWS: use consistent quoting

* NEWS: Change unmatched curly quote to more consistent single quote.

2 years agodoc: be more consistent when documenting exit status
Pádraig Brady [Tue, 27 Sep 2022 20:59:01 +0000 (21:59 +0100)] 
doc: be more consistent when documenting exit status

* src/system.h (emit_exec_status): A new function to
output standard "Exit status:" info for commands that exec others.
* doc/coreutils.texi (Exit status): Add "ls" and "runcon"
to the list of commands with non standard exit status.
* src/numfmt.c (main): Call initialize_exit_failure() explicitly
to better indicate this utility may exit with something other than
EXIT_FAILURE.
* src/timeout.c (usage): Use more consistent capitalization.
* src/chroot.c: Call emit_exec_status().
* src/env.c: Likewise.
* src/nice.c: Likewise.
* src/nohup.c: Likewise.
* src/runcon.c: Likewise.
* src/stdbuf.c: Likewise.