Jim Meyering [Thu, 4 Mar 2004 08:42:20 +0000 (08:42 +0000)]
Include "cloexec.h" first, and <unistd.h> before <fcntl.h>.
(set_cloexec_flag): Use bool for booleans. All uses changed.
If F_GETFD returns a negative number (not just -1), report a
failure. Don't use F_SETFD if the flags are already right.
Don't report a failure with F_SETFD unless it returns -1.
Jim Meyering [Wed, 3 Mar 2004 07:57:33 +0000 (07:57 +0000)]
Don't include "posixver.h".
(parse_user_spec): Fall back on USER.GROUP parsing regardless
of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
compatible extension. Simplify code by removing a boolean int
that was always nonzero if a string was nonnull.
Jim Meyering [Wed, 3 Mar 2004 07:52:36 +0000 (07:52 +0000)]
(chown invocation): Document that chown now falls
back on USER.GROUP parsing regardless of POSIX version, as POSIX
1003.1-2001 allows that behavior as a compatible extension.
Jim Meyering [Tue, 2 Mar 2004 22:49:44 +0000 (22:49 +0000)]
Include <signal.h> when checking for strsignal,
sys_siglist, and friends. Problem reported by Toney Leneis in
<http://mail.gnu.org/archive/html/bug-coreutils/2004-02/msg00136.html>.
Jim Meyering [Sun, 22 Feb 2004 14:56:58 +0000 (14:56 +0000)]
(eval, eval7, eval6, eval5, eval4, eval3, eval2, eval1):
Accept a bool argument specifying whether to evaluate the
expression. This is to allow short-circuit evaluation. All
callers changed.
(null): Report that a string is zero even if it has
a form like "-0" or "00".
(eval1, eval): Use short-circuit evaluation for | and &.
(eval): Return 0 if both arguments are null or zero, instead
of returning the first argument.
Jim Meyering [Sat, 21 Feb 2004 09:31:11 +0000 (09:31 +0000)]
(expr invocation):
Document what forms integers may take, and say "integer"
consistently instead of "number". Warn about operands
that "expr" can misinterpret, and how to work around the problem.
Jim Meyering [Sat, 21 Feb 2004 09:21:15 +0000 (09:21 +0000)]
(usage): Tell what comm does when there are no options.
Reword in terms of FILE1 and FILE2 rather than `left file' and
`right file'. Suggestion from Dan Jacobson.
Jim Meyering [Tue, 17 Feb 2004 10:52:49 +0000 (10:52 +0000)]
(usage) [-u]: Add punctuation so that the description in
the help2man-generated (line-joined) man page is more readable.
Reported by Tim Waugh.
[-T]: Add a semicolon, for the same reason.
Jim Meyering [Tue, 10 Feb 2004 08:17:33 +0000 (08:17 +0000)]
(dist-hook): New target, to ensure that config/install-sh
is executable. Otherwise, on systems that lack a suitable install
binary, `make install' would fail, because of the way this script
is invoked (without `$SHELL ' prefix).
Jim Meyering [Sat, 7 Feb 2004 16:01:20 +0000 (16:01 +0000)]
(re_protect): Use `XSTAT (x, ...)' in place of `*(x->xstat) (...)'.
(do_copy): Declare/use local xstat rather than x->xstat.
(main): Remove code that set x.xstat.
Jim Meyering [Sat, 7 Feb 2004 16:01:02 +0000 (16:01 +0000)]
Remove xstat function pointer member. The way it was used was not
portable, since some systems (OSF V5.1, Solaris 2.5.1) provide static
inline `stat' and `lstat' functions, thus making the tests of
`xstat == lstat' in copy.c always fail.
(struct cp_options) [xstat]: Remove member.
(XSTAT): New macro.
Jim Meyering [Sat, 7 Feb 2004 16:00:28 +0000 (16:00 +0000)]
Remove xstat function pointer member. The way it was used was not
portable, since some systems (OSF V5.1, Solaris 2.5.1) provide static
inline `stat' and `lstat' functions, thus making the tests of
`xstat == lstat' in copy.c always fail.
(copy_dir): Set `.dereference' member, not .xstat.
(copy_internal): Use `XSTAT (x, ...)' in place of `*(x->xstat) (...)'.
Use `x->dereference == DEREF_NEVER' in place of `x->xstat == lstat'.
(valid_options): Remove now-obsolete FIXME comments.