Eric Blake [Thu, 2 Sep 2010 19:49:41 +0000 (13:49 -0600)]
tests: init.sh improvements for re-exec'ing with zsh
Tom's IRIX setup had a broken bash, and proceeded to run zsh
outside of POSIX mode. But trying to trace that setup proved
difficult, since the re-exec lost tracing.
* tests/init.sh: Borrow autoconf POSIX-mode sanitization. Pass
-vx through shell re-exec.
Reported by Tom G. Christensen.
Bruno Haible [Thu, 2 Sep 2010 09:15:39 +0000 (11:15 +0200)]
wctype: Avoid compilation error on IRIX 6.5.30.
* lib/wctype.in.h (iswblank): Declare with a replacement if
REPLACE_ISWBLANK is set.
* m4/wctype_h.m4 (gl_WCTYPE_H): Check also whether iswblank is
declared. Set REPLACE_ISWBLANK.
* modules/wctype (Makefile.am): Substitute REPLACE_ISWBLANK.
* doc/posix-functions/iswblank.texi: Mention the IRIX 6.5.30 problem.
* doc/posix-headers/wctype.texi: Likewise.
Reported by Tom G. Christensen <tgc@jupiterrise.com>.
Paul Eggert [Wed, 1 Sep 2010 20:45:53 +0000 (13:45 -0700)]
fcntl-h, etc.: prefer O_SEARCH to O_RDONLY when applicable
POSIX 2008 specifies a new 'open' flag O_SEARCH, which can be used
when one needs search access to a directory but not read access.
On systems where it is available, it works in some cases where
O_RDONLY does not, namely on directories that are searchable but
not readable, and which need only to be searchable. If O_SEARCH
is not available, fall back to the traditional method of using
O_RDONLY.
* lib/fcntl.in.h (O_SEARCH): #define to O_RDONLY if not defined.
* lib/chdir-long.c (cdb_advance_fd): Use O_SEARCH, not O_RDONLY,
when opening a directory that needs only to be searchable.
* lib/chdir-safer.c (chdir_no_follow): Likewise.
* lib/fts.c (diropen, fts_open, fd_ring_check): Likewise.
* lib/openat-proc.c (openat_proc_name): Likewise.
* lib/openat.c (openat_needs_fchdir): Likewise.
* lib/save-cwd.c (save_cwd): Likewise.
* lib/savewd.c (savewd_save, savewd_chdir): Likewise.
Eric Blake [Tue, 31 Aug 2010 08:10:32 +0000 (10:10 +0200)]
hash: factor, and guard against misbehaving hasher function
* lib/hash.c (safe_hasher): New function, to encapsulate the checking
of table->hasher's return value. Also protect against a hash value
so large that adding it to table->bucket results in a NULL pointer.
(hash_lookup, hash_get_next, hash_find_entry, transfer_entries):
Use it in place of open-coded check-and-abort.
read-file: Avoid memory reallocations with regular files.
* lib/read-file.c: Include <sys/stat.h>, <stdio.h>, <stdint.h>.
(fread_file): With regular files, use the remaining length as the
initial buffer size. Check against overflow.
* modules/read-file (Depends-on): Add ftello, malloc-posix, stdint,
sys_stat.
Eric Blake [Thu, 26 Aug 2010 22:43:13 +0000 (16:43 -0600)]
btowc: fix missing file
Detected by ./gnulib-tool --test btowc.
configure.ac:111: warning: gt_LOCALE_FR is m4_require'd but not m4_defun'd
glm4/btowc.m4:7: gl_FUNC_BTOWC is expanded from...
configure.ac:27: gl_INIT is expanded from...
configure.ac:111: the top level
Eric Blake [Thu, 26 Aug 2010 22:12:06 +0000 (16:12 -0600)]
include_next: silence autoconf 2.68 warning
Next warning spotted by Autoconf; this time it is spurious (when
checking for a working include_next, we could care less what other
defines have already been provided by AC_DEFINE). Which makes this
the first real-world use case outside of autoconf guts that can
reasonably use the new autoconf macro.
* m4/include_next.m4 (gl_INCLUDE_NEXT): Mark this use of
AC_COMPILE_IFELSE as special.
(AC_LANG_DEFINES_PROVIDED): Provide dummy implementation for
autoconf < 2.68.
Paul Eggert [Tue, 24 Aug 2010 05:34:00 +0000 (22:34 -0700)]
priv-set: fix comments
* lib/priv-set.c (priv_set_remove, priv_set_restore): Fix comments
to match code, as suggested by David Bartley in:
http://lists.gnu.org/archive/html/bug-tar/2010-08/msg00018.html
Eric Blake [Mon, 23 Aug 2010 21:04:42 +0000 (15:04 -0600)]
stdbool: avoid rejecting clang
* m4/stdbool.m4 (AC_HEADER_STDBOOL): Resync with autoconf.
* tests/test-stdbool.c: Enable more tests if using the system
<stdbool.h> instead of the gnulib replacement.
(main): Move xlc bug test to a runtime test for all compilers.
Reported by Anders Kaseorg.
Paolo Bonzini [Mon, 23 Aug 2010 07:35:43 +0000 (09:35 +0200)]
poll, select: handle ERROR_BROKEN_PIPE.
* lib/poll.c (win32_compute_revents): Return POLLHUP when
PeekNamedPipe fails with ERROR_BROKEN_PIPE.
* lib/select.c (win32_compute_revents): Do not mark a pipe
as writeable if PeekNamedPipe fails with ERROR_BROKEN_PIPE.
Eric Blake [Mon, 16 Aug 2010 23:34:45 +0000 (17:34 -0600)]
test-stddef: test for (some) offsetof bugs
See the mailing list for a more comprehensive patch that works
around the Solaris bug.
* tests/test-stddef.c: Enhance test to ensure correct type of
offsetof.
* doc/posix-headers/stddef.texi (stddef.h): Document a Solaris bug
that we are not fixing at this time.
Pádraig Brady [Thu, 10 Jun 2010 14:12:48 +0000 (15:12 +0100)]
copy-acl: ignore ENOTSUP on HP-UX
Fixes Coreutils bug 6053.
* lib/acl-internal.h (ACL_NOT_WELL_SUPPORTED): Move definition up,
so that it is available for HP-UX.
* lib/copy-acl.c (qcopy_acl): Use it.
Reported by Patrick M. Callahan.
Eric Blake [Tue, 10 Aug 2010 15:32:13 +0000 (09:32 -0600)]
open, chown: relax license
* modules/open (License): Change to LGPLv2+, with consent by all
authors, for use in augeas.
* modules/chown (License): Likewise.
* modules/lchown (Likewise): Likewise.
Requested by Adam Stokes.
Eric Blake [Fri, 30 Jul 2010 23:29:43 +0000 (17:29 -0600)]
mknod: be more vocal about danger of running tests as root
* m4/mknod.m4 (gl_FUNC_MKNOD): Make it harder to run configure as
root, since that is just asking for problems.
Suggested by Bruno Haible, based on a report by Rainer Tammer.