gnulib.git
14 years agodoc: correct availability of cygwin 1.5.x getopt
Eric Blake [Thu, 31 Dec 2009 15:48:16 +0000 (08:48 -0700)]
doc: correct availability of cygwin 1.5.x getopt

* doc/posix-functions/optarg.texi (optarg): Cygwin supplies getopt
variables.
* doc/posix-functions/opterr.texi (opterr): Likewise.
* doc/posix-functions/optind.texi (optind): Likewise.
* doc/posix-functions/optopt.texi (optopt): Likewise.
* doc/posix-functions/tzname.texi (tzname): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agoopenat: update maintainer
Eric Blake [Thu, 31 Dec 2009 15:33:43 +0000 (08:33 -0700)]
openat: update maintainer

* modules/openat (Maintainer): Add myself.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agoutimens: avoid shadowing warning
Eric Blake [Thu, 31 Dec 2009 19:28:35 +0000 (12:28 -0700)]
utimens: avoid shadowing warning

lutimens declared struct stat st in two scopes.  Worse, on Linux
kernels between 2.6.18 and 2.6.22 (when utimensat existed, but
rejected AT_SYMLINK_NOFOLLOW) or before 2.6.18 (if the glibc
headers have utimensat, but the kernel does not), it would
result in redundant [fl]stat calls.

* lib/utimens.c (fdutimens, lutimens): Consolidate separate stat
buffers into one, to avoid shadowing, as well as avoiding a
redundant stat.
Reported by Jim Meyering.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agotest-dup2: avoid compiler warning
Eric Blake [Thu, 31 Dec 2009 20:43:28 +0000 (13:43 -0700)]
test-dup2: avoid compiler warning

A warning cropped up from the 2009-12-28 change, when not using cloexec.

* tests/test-dup2.c (is_inheritable): Only define if used.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agovasnprintf: Avoid passing an 'rpl_mbstate_t *' to the system's wcrtomb.
Bruno Haible [Fri, 1 Jan 2010 01:59:04 +0000 (02:59 +0100)]
vasnprintf: Avoid passing an 'rpl_mbstate_t *' to the system's wcrtomb.

14 years agoiconv: Reject native Solaris iconv.
Bruno Haible [Fri, 1 Jan 2010 00:57:29 +0000 (01:57 +0100)]
iconv: Reject native Solaris iconv.

14 years agoFix mistake in last patch of tests/test-signal.c.
Bruno Haible [Thu, 31 Dec 2009 22:33:04 +0000 (23:33 +0100)]
Fix mistake in last patch of tests/test-signal.c.

14 years agospawn: Fix incomplete fix.
Bruno Haible [Thu, 31 Dec 2009 22:29:51 +0000 (23:29 +0100)]
spawn: Fix incomplete fix.

14 years agoAvoid namespace pollution on glibc systems.
Bruno Haible [Thu, 31 Dec 2009 21:54:32 +0000 (22:54 +0100)]
Avoid namespace pollution on glibc systems.

14 years agoFurther updates, following today's commits.
Bruno Haible [Thu, 31 Dec 2009 21:41:49 +0000 (22:41 +0100)]
Further updates, following today's commits.

14 years agoFix bug in last change of m4/sys_select_h.m4.
Bruno Haible [Thu, 31 Dec 2009 21:27:32 +0000 (22:27 +0100)]
Fix bug in last change of m4/sys_select_h.m4.

14 years agoComplete last change to m4/sys_utsname_h.m4.
Bruno Haible [Thu, 31 Dec 2009 21:24:22 +0000 (22:24 +0100)]
Complete last change to m4/sys_utsname_h.m4.

14 years agospawn: Fix misapplied patch.
Bruno Haible [Thu, 31 Dec 2009 21:02:09 +0000 (22:02 +0100)]
spawn: Fix misapplied patch.

14 years agotimes: Update after sys_times changed.
Bruno Haible [Thu, 31 Dec 2009 20:31:35 +0000 (21:31 +0100)]
times: Update after sys_times changed.

14 years agoUse AC_C_INLINE where necessary.
Bruno Haible [Thu, 31 Dec 2009 15:13:01 +0000 (16:13 +0100)]
Use AC_C_INLINE where necessary.

14 years agoUse AC_C_INLINE instead of module 'inline' where possible.
Bruno Haible [Thu, 31 Dec 2009 14:47:10 +0000 (15:47 +0100)]
Use AC_C_INLINE instead of module 'inline' where possible.

14 years agoRemove unnecessary AC_C_INLINE invocation.
Bruno Haible [Thu, 31 Dec 2009 14:12:41 +0000 (15:12 +0100)]
Remove unnecessary AC_C_INLINE invocation.

14 years agomaint.mk: don't require explicit gpg_key_ID in cfg.mk
Jim Meyering [Thu, 31 Dec 2009 15:31:11 +0000 (16:31 +0100)]
maint.mk: don't require explicit gpg_key_ID in cfg.mk

* top/maint.mk (gpg_key_ID): Derive key ID from signed release tag.
With this change, we can all remove the gpg_key_ID = ... definition
from our respective cfg.mk files.

14 years agomaint.mk: create announcement template in ~/, not in /tmp
Jim Meyering [Thu, 31 Dec 2009 14:59:29 +0000 (15:59 +0100)]
maint.mk: create announcement template in ~/, not in /tmp

* top/maint.mk (emit_upload_commands): Adjust.
(release-prep): Emit into ~/announce-..., not /tmp/announce-...
Remove temporary file, .ci-msg.

14 years agoautoupdate
Karl Berry [Thu, 31 Dec 2009 14:20:57 +0000 (06:20 -0800)]
autoupdate

14 years agolink-warning: always build headers with link warnings
Eric Blake [Thu, 24 Dec 2009 19:06:48 +0000 (12:06 -0700)]
link-warning: always build headers with link warnings

Replacement headers must be built unconditionally if they use
GL_LINK_WARNING, if the warning is to ever trigger on a
glibc system during CFLAGS=-DGNULIB_POSIXCHECK.

* modules/arpa_inet (Makefile.am): Always build replacement
header.
* modules/ctype (Makefile.am): Likewise.
* modules/dirent (Makefile.am): Likewise.
* modules/inttypes (Makefile.am): Likewise.
* modules/langinfo (Makefile.am): Likewise.
* modules/locale (Makefile.am): Likewise.
* modules/spawn (Makefile.am): Likewise.
* modules/sys_file (Makefile.am): Likewise.
* modules/sys_ioctl (Makefile.am): Likewise.
* modules/sys_select (Makefile.am): Likewise.
* modules/sys_socket (Makefile.am): Likewise.
* modules/sys_times (Makefile.am): Likewise.
* modules/sys_utsname (Makefile.am): Likewise.
* modules/sys_wait (Makefile.am): Likewise.
* modules/wchar (Makefile.am): Likewise.
* m4/arpa_inet_h.m4 (gl_HEADER_ARPA_INET)
(gl_ARPA_INET_H_DEFAULTS): Drop unneeded variable.
* m4/ctype.m4 (gl_CTYPE_H_DEFAULTS): Likewise.
* m4/isblank.m4 (gl_FUNC_ISBLANK): Likewise.
* m4/dirent_h.m4 (gl_REPLACE_DIRENT_H, gl_DIRENT_H_DEFAULTS):
Likewise.
* m4/inttypes.m4 (gl_INTTYPES_H): Likewise.
* m4/langinfo_h.m4 (gl_LANGINFO_H): Likewise.
* m4/locale_h.m4 (gl_REPLACE_LOCALE_H, gl_LOCALE_H_DEFAULTS):
Likewise.
* m4/spawn_h.m4 (gl_REPLACE_SPAWN_H, gl_SPAWN_H_DEFAULTS):
Likewise.
* m4/sys_file_h.m4 (gl_HEADER_SYS_FILE_H): Likewise.
* m4/sys_ioctl_h.m4 (gl_SYS_IOCTL_H, gl_REPLACE_SYS_IOCTL_H)
(gl_SYS_IOCTL_H_DEFAULTS): Likewise.
* m4/sys_select_h.m4 (gl_HEADER_SYS_SELECT): Likewise.
* m4/sys_times_h.m4 (gl_SYS_TIMES_H): Likewise.
* m4/sys_utsname_h.m4 (gl_SYS_UTSNAME_H)
(gl_SYS_UTSNAME_H_DEFAULTS): Likewise.
* m4/wchar.m4 (gl_WCHAR_H, gl_REPLACE_WCHAR_H)
(gl_WCHAR_H_DEFAULTS): Likewise.

14 years agosignal, spawn: use link warnings
Eric Blake [Wed, 30 Dec 2009 21:42:41 +0000 (14:42 -0700)]
signal, spawn: use link warnings

These modules depended on link-warning, then didn't use it.

* lib/signal.in.h (sigset_t): Make unconditional.
(sigismember, sigemptyset, sigaddset, sigdelset, sigfillset)
(sigpending, sigprocmask, sigaction): Add link warnings.
* lib/spawn.in.h (posix_spawn, posix_spawnp, posix_spawnattr_init)
(posix_spawnattr_destroy, posix_spawnattr_getsigdefault)
(posix_spawnattr_setsigdefault, posix_spawnattr_getsigmask)
(posix_spawnattr_setsigmask, posix_spawnattr_getflags)
(posix_spawnattr_setflags, posix_spawnattr_getpgroup)
(posix_spawnattr_setpgroup, posix_spawnattr_getschedpolicy)
(posix_spawnattr_setschedpolicy, posix_spawnattr_getschedparam)
(posix_spawnattr_setschedparam, posix_spawn_file_actions_init)
(posix_spawn_file_actions_destroy)
(posix_spawn_file_actions_addopen)
(posix_spawn_file_actions_addclose)
(posix_spawwn_file_actions_adddup2): Likewise.
* m4/signal_h.m4 (gl_SIGNAL_H): Guarantee uid_t.
* tests/test-signal.c (main): Enhance test.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agospawn: improve wrapper support
Eric Blake [Wed, 30 Dec 2009 18:52:31 +0000 (11:52 -0700)]
spawn: improve wrapper support

Avoid type conflicts if overriding system header.

* m4/spawn_h.m4 (gl_SPAWN_H): Check for type existence.
(gl_SPAWN_H_DEFAULTS): New defaults.
* modules/spawn (Makefile.am): Substitute them.
* lib/spawn.in.h: (posix_spawnattr_t, posix_spawn_file_actions_t):
Only declare if missing or broken.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agosys_times, sys_utsname: use include_next
Eric Blake [Wed, 30 Dec 2009 16:47:55 +0000 (09:47 -0700)]
sys_times, sys_utsname: use include_next

Another step towards being able to make GL_LINK_WARNING useful.

* m4/sys_times_h.m4 (gl_SYS_TIMES_H): Support wrapping an existing
header.
(gl_SYS_TIMES_H_DEFAULTS): Add another variable.
* m4/sys_utsname_h.m4 (gl_SYS_UTSNAME_H)
(gl_SYS_UTSNAME_H_DEFAULTS): Likewise.
* modules/sys_times (Depends-on): Add include_next.
(Makefile.am): Substitute additional values.
* modules/sys_utsname (Depends-on, Makefile.am): Likewise.
* lib/sys_times.in.h (includes): Include native header, if
available.
* lib/sys_utsname.in.h (includes): Likewise.
* tests/test-sys_times.c (main): Enhance test.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agofdutimensat: revert prior patch
Eric Blake [Thu, 31 Dec 2009 12:42:02 +0000 (05:42 -0700)]
fdutimensat: revert prior patch

This reverts commit 2c391ad5ed26c01e161b5de30d3a225fabe08731.

* modules/fdutimensat (Depends-on): Re-add inline; it is needed by
utimens.h.
Reported by Bruno Haible.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agosys_wait: drop link-warning dependency
Eric Blake [Wed, 30 Dec 2009 18:59:29 +0000 (11:59 -0700)]
sys_wait: drop link-warning dependency

Until gnulib provides any replacement for functions in <sys/wait.h>,
the header does not need to depend on link-warning.

* modules/sys_wait (Depends-on, Makefile.am): Drop unneeded
link-warning efforts.
* lib/sys_wait.in.h: Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agofdutimensat: remove bogus dependency
Eric Blake [Wed, 30 Dec 2009 23:51:26 +0000 (16:51 -0700)]
fdutimensat: remove bogus dependency

* modules/fdutimensat (Depends-on): Drop inline.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agounistd: fix typo
Eric Blake [Wed, 30 Dec 2009 23:14:05 +0000 (16:14 -0700)]
unistd: fix typo

This typo ended up incompatibly re-defining the macro link()
during -DGNULIB_POSIXCHECK=1.  However, gcc's pragma system_header
squelches that particular warning, so this typo went unnoticed.

* lib/unistd.in.h (linkat) [GNULIB_POSIXCHECK]: Fix typo.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agoFix compilation error with Solaris cc.
Bruno Haible [Thu, 31 Dec 2009 03:03:24 +0000 (04:03 +0100)]
Fix compilation error with Solaris cc.

14 years agoFix test crash.
Bruno Haible [Thu, 31 Dec 2009 01:36:46 +0000 (02:36 +0100)]
Fix test crash.

14 years agoFix compilation error on most platforms.
Bruno Haible [Thu, 31 Dec 2009 01:28:19 +0000 (02:28 +0100)]
Fix compilation error on most platforms.

14 years agofutimens, utimensat: work around ntfs-3g bug
Eric Blake [Wed, 30 Dec 2009 13:48:46 +0000 (06:48 -0700)]
futimens, utimensat: work around ntfs-3g bug

With ntfs-3g, use of a single UTIME_OMIT failed to make any change
to the remaining two timestamps.  Furthermore, the previous fix
for ctime happens to be specific to xfs, rather than global to
the kernel.  Therefore, to be valid, a cache would have to be
per-device, which gets too expensive, especially considering that
the cost of a preparatory stat pulls the file into kernel cache
to speed up the resulting utimensat.  So, blindly massage UTIME_OMIT
on Linux, even on working filesystems like ext4.

The bugs in xfs and ntfs-3g were reported to the kernel folks,
and fixes written, but it will be several years before gnulib
can assume that file systems in use have picked up the fixes.

* lib/utimensat.c (rpl_utimensat): Drop attempts to cache whether
a ctime bug is present, and expand workaround to cover ntfs-3g.
* lib/utimens.c (fdutimens, lutimens): Likewise.
(utimensat_ctime_really, detect_ctime_bug): Drop cache mechanism.
(validate_timespec): Adjust return value.
* m4/futimens.m4 (gl_FUNC_FUTIMENS): Update comment.
* m4/utimensat.m4 (gl_FUNC_UTIMENSAT): Likewise.
Reported by ctrn3e8 <ctrn3e8@gmail.com>.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agolink-warning: make usage consistent
Eric Blake [Thu, 24 Dec 2009 14:19:23 +0000 (07:19 -0700)]
link-warning: make usage consistent

Ensure GL_LINK_WARNING is defined before use.

* modules/ctype (Depends-on): Add link-warning.
(Makefile.am): Update rules accordingly.
* modules/langinfo (Depends-on, Makefile.am): Likewise.
* modules/locale (Depends-on, Makefile.am): Likewise.
* modules/sys_file (Makefile.am): Likewise.
* modules/getopt-posix (Makefile.am): Delete unused link warning
efforts.
* lib/ctype.in.h (GL_LINK_WARNING): Ensure definition before use.
* lib/langinfo.in.h (GL_LINK_WARNING): Likewise.
* lib/locale.in.h (GL_LINK_WARNING): Likewise.
* lib/sys_file.in.h (GL_LINK_WARNING): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agostdio: remove unused variables
Eric Blake [Wed, 30 Dec 2009 04:39:33 +0000 (21:39 -0700)]
stdio: remove unused variables

Leftovers from 2007-05-24, commit e461ff7387.

* m4/stdio_h.m4 (gl_STDIO_H_DEFAULTS): Remove unused variables.
* m4/fseeko.m4 (gl_FUNC_FSEEKO): Likewise.
* m4/ftello.m4 (gl_FUNC_FTELLO): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agotests: test more substitute headers
Eric Blake [Wed, 30 Dec 2009 00:01:09 +0000 (17:01 -0700)]
tests: test more substitute headers

Add tests of common headers, in preparation of always providing
a gnulib wrapper (for improved LINK_WARNING support).

* modules/ctype-tests: New file.
* modules/dirent-tests: Likewise.
* modules/spawn-tests: Likewise.
* modules/sys_file-tests: Likewise.
* modules/sys_ioctl-tests: Likewise.
* modules/sys_wait-tests: Likewise.
* tests/test-ctype.c: Likewise.
* tests/test-dirent.c: Likewise.
* tests/test-spawn.c: Likewise.
* tests/test-sys_file.c: Likewise.
* tests/test-sys_ioctl.c: Likewise.
* tests/test-sys_wait.c: Likewise.
* m4/spawn_h.m4 (gl_SPAWN_H): Replace header if it is missing.
* lib/sys_file.in.h (LOCK_SH, LOCK_EX, LOCK_UN, LOCK_NB): Provide
whether or not flock is in use.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agotests: remove License section from module
Eric Blake [Tue, 29 Dec 2009 22:45:18 +0000 (15:45 -0700)]
tests: remove License section from module

Per modules/TEMPLATE-TESTS, test modules do not need a license
section.  This is because all tests are implicitly GPLv3+, with
no conflict even in an LGPL or GPLv2 client, because the tests
are not linked into the client executable.  Delete the existing
License sections with the following:

  find modules -name '*-tests' | xargs grep -l License \
    | xargs sed -i '/^$/N; /License:/,$ d'

* modules/arpa_inet-tests: Remove unneeded section.
* modules/byteswap-tests: Likewise.
* modules/ceilf-tests: Likewise.
* modules/ceill-tests: Likewise.
* modules/crypto/des-tests: Likewise.
* modules/crypto/gc-arcfour-tests: Likewise.
* modules/crypto/gc-arctwo-tests: Likewise.
* modules/crypto/gc-des-tests: Likewise.
* modules/crypto/gc-hmac-md5-tests: Likewise.
* modules/crypto/gc-hmac-sha1-tests: Likewise.
* modules/crypto/gc-md2-tests: Likewise.
* modules/crypto/gc-md4-tests: Likewise.
* modules/crypto/gc-md5-tests: Likewise.
* modules/crypto/gc-pbkdf2-sha1-tests: Likewise.
* modules/crypto/gc-rijndael-tests: Likewise.
* modules/crypto/gc-sha1-tests: Likewise.
* modules/crypto/gc-tests: Likewise.
* modules/crypto/md2-tests: Likewise.
* modules/crypto/md4-tests: Likewise.
* modules/fcntl-h-tests: Likewise.
* modules/floorf-tests: Likewise.
* modules/floorl-tests: Likewise.
* modules/frexp-nolibm-tests: Likewise.
* modules/frexp-tests: Likewise.
* modules/frexpl-nolibm-tests: Likewise.
* modules/frexpl-tests: Likewise.
* modules/getaddrinfo-tests: Likewise.
* modules/inttypes-tests: Likewise.
* modules/isfinite-tests: Likewise.
* modules/isinf-tests: Likewise.
* modules/ldexpl-tests: Likewise.
* modules/locale-tests: Likewise.
* modules/math-tests: Likewise.
* modules/netdb-tests: Likewise.
* modules/netinet_in-tests: Likewise.
* modules/printf-frexp-tests: Likewise.
* modules/printf-frexpl-tests: Likewise.
* modules/priv-set-tests: Likewise.
* modules/random_r-tests: Likewise.
* modules/round-tests: Likewise.
* modules/roundf-tests: Likewise.
* modules/roundl-tests: Likewise.
* modules/search-tests: Likewise.
* modules/select-tests: Likewise.
* modules/signal-tests: Likewise.
* modules/stdbool-tests: Likewise.
* modules/stddef-tests: Likewise.
* modules/stdint-tests: Likewise.
* modules/stdio-tests: Likewise.
* modules/stdlib-tests: Likewise.
* modules/string-tests: Likewise.
* modules/strings-tests: Likewise.
* modules/sys_select-tests: Likewise.
* modules/sys_socket-tests: Likewise.
* modules/sys_stat-tests: Likewise.
* modules/sys_time-tests: Likewise.
* modules/sys_utsname-tests: Likewise.
* modules/sysexits-tests: Likewise.
* modules/time-tests: Likewise.
* modules/trunc-tests: Likewise.
* modules/truncf-tests: Likewise.
* modules/truncl-tests: Likewise.
* modules/tsearch-tests: Likewise.
* modules/unistd-tests: Likewise.
* modules/wchar-tests: Likewise.
* modules/wctype-tests: Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agotests: fix license on several tests
Eric Blake [Tue, 29 Dec 2009 16:25:40 +0000 (09:25 -0700)]
tests: fix license on several tests

The use of GPLv2+ was a relic of copy-and-paste, and not intentional.

* tests/test-des.c: Update to GPLv3+.
* tests/test-flock.c: Likewise.
* tests/test-fsync.c: Likewise.
* tests/test-futimens.h: Likewise.
* tests/test-gc-arcfour.c: Likewise.
* tests/test-gc-arctwo.c: Likewise.
* tests/test-gc-des.c: Likewise.
* tests/test-gc-hmac-md5.c: Likewise.
* tests/test-gc-hmac-sha1.c: Likewise.
* tests/test-gc-md2.c: Likewise.
* tests/test-gc-md4.c: Likewise.
* tests/test-gc-md5.c: Likewise.
* tests/test-gc-pbkdf2-sha1.c: Likewise.
* tests/test-gc-rijndael.c: Likewise.
* tests/test-gc-sha1.c: Likewise.
* tests/test-gc.c: Likewise.
* tests/test-getcwd.c: Likewise.
* tests/test-link.c: Likewise.
* tests/test-link.h: Likewise.
* tests/test-lutimens.h: Likewise.
* tests/test-md2.c: Likewise.
* tests/test-md4.c: Likewise.
* tests/test-mkdir.h: Likewise.
* tests/test-rename.c: Likewise.
* tests/test-rename.h: Likewise.
* tests/test-safe-alloc.c: Likewise.
* tests/test-utimens-common.h: Likewise.
* tests/test-utimens.h: Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agomaint: sync license texts
Eric Blake [Tue, 29 Dec 2009 18:19:22 +0000 (11:19 -0700)]
maint: sync license texts

* config/srclist.txt: Add gpl-1.3.texi, lgpl-1.3.texi.
* doc/gpl-3.0.texi: Revert copyright year update.
* doc/lgpl-3.0.texi: Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agoupdate nearly all FSF copyright year lists to include 2009
Jim Meyering [Mon, 28 Dec 2009 09:50:36 +0000 (10:50 +0100)]
update nearly all FSF copyright year lists to include 2009

The files named by the following are exempted:

    grep -v '^#' config/srclist.txt|grep -v '^$' \
      | while read src dst; do
          test -f "$dst" && { echo "$dst"; continue; }
          test -d "$dst" || continue
          echo "$dst"/$(basename "$src")
        done > exempt
    git ls-files tests/unictype >> exempt

In the remaining files, convert to all-interval notation if
- there is already at least one year interval like 2000-2003
- the file is maintained by me
- the file is in lib/uni*/, where that style already prevails
Otherwise, use update-copyright's default.

14 years agotests: don't require debug system() to pass
Eric Blake [Tue, 29 Dec 2009 13:58:18 +0000 (06:58 -0700)]
tests: don't require debug system() to pass

When running a cross-compilation to mingw on a Linux host,
but without a valid mingw rm executable, the debug-only
system() call would fail.  This is not fatal to the test,
since the call is merely a debugging aid if a prior call to
the test encountered a failure and left garbage; in general,
the tests should pass and the system() call have nothing to
clean in the first place.  Also, the system() call only
needs to happen once at startup, not once per iteration
into the tests performed by .h files.

* tests/test-lstat.h (test_lstat_func): Move debug cleanup...
* tests/test-rmdir.h (test_rmdir_func): Likewise.
* tests/test-unlink.h (test_unlink_func): Likewise.
* tests/test-fstatat.c (main): ...into callers.
* tests/test-lstat.c (main): Likewise.
* tests/test-rmdir.c (main): Likewise.
* tests/test-unlink.c (main): Likewise.
* tests/test-unlinkat.c (main): Likewise.
* tests/test-areadlink-with-size.c (main): Don't require a
debug-only system call to pass, aiding cross-testing to mingw.
* tests/test-areadlink.c (main): Likewise.
* tests/test-areadlinkat-with-size.c (main): Likewise.
* tests/test-areadlinkat.c (main): Likewise.
* tests/test-canonicalize-lgpl.c (main): Likewise.
* tests/test-canonicalize.c (main): Likewise.
* tests/test-chown.c (main): Likewise.
* tests/test-fchownat.c (main): Likewise.
* tests/test-lchown.c (main): Likewise.
* tests/test-fdutimensat.c (main): Likewise.
* tests/test-futimens.c (main): Likewise.
* tests/test-link.c (main): Likewise.
* tests/test-linkat.c (main): Likewise.
* tests/test-mkdir.c (main): Likewise.
* tests/test-mkdirat.c (main): Likewise.
* tests/test-mkfifo.c (main): Likewise.
* tests/test-mkfifoat.c (main): Likewise.
* tests/test-mknod.c (main): Likewise.
* tests/test-readlink.c (main): Likewise.
* tests/test-remove.c (main): Likewise.
* tests/test-rename.c (main): Likewise.
* tests/test-renameat.c (main): Likewise.
* tests/test-symlink.c (main): Likewise.
* tests/test-symlinkat.c (main): Likewise.
* tests/test-utimens.c (main): Likewise.
* tests/test-utimensat.c (main): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agomodules/selinux-h: Depend on $(UNUSED_PARAMETER_H).
Simon Josefsson [Tue, 29 Dec 2009 07:02:30 +0000 (08:02 +0100)]
modules/selinux-h: Depend on $(UNUSED_PARAMETER_H).

14 years agoupdate-copyright: you may specify a max. line length other than 72
Jim Meyering [Mon, 28 Dec 2009 11:06:03 +0000 (12:06 +0100)]
update-copyright: you may specify a max. line length other than 72

* build-aux/update-copyright: Honor $UPDATE_COPYRIGHT_MAX_LINE_LENGTH.

14 years agomaint: use consistent FSF copyright line syntax
Jim Meyering [Mon, 28 Dec 2009 10:55:13 +0000 (11:55 +0100)]
maint: use consistent FSF copyright line syntax

* lib/posixtm.c: Add missing comma in FSF copyright line.
* lib/posixtm.h: Likewise.
* lib/getugroups.c: Add missing ", Inc.".

14 years agopmccabe2html: emit consistent FSF copyright; remove trailing blanks
Jim Meyering [Mon, 28 Dec 2009 10:46:43 +0000 (11:46 +0100)]
pmccabe2html: emit consistent FSF copyright; remove trailing blanks

* build-aux/pmccabe2html: Insert comma before "Inc." in emitted
FSF copyright line.  Remove trailing blanks.

14 years agotest-dup2: reduce dependencies
Eric Blake [Mon, 28 Dec 2009 13:24:04 +0000 (06:24 -0700)]
test-dup2: reduce dependencies

dup2 is fully tested if the cloexec module is in use, but it is
also used in a number of modules where dragging in cloexec is
over the top for just using dup2 to test whether an fd is valid.

* modules/cloexec (Configure.ac): Set witness.
* modules/dup2-tests (Depends-on): Drop cloexec.
* tests/test-dup2.c (main): Skip portion of test if cloexec module
not present.
Suggested by Bruno Haible.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agoRemove an unneeded dependency.
Bruno Haible [Sat, 26 Dec 2009 18:58:13 +0000 (19:58 +0100)]
Remove an unneeded dependency.

14 years agotests: use macros.h in more places
Eric Blake [Fri, 25 Dec 2009 23:06:48 +0000 (16:06 -0700)]
tests: use macros.h in more places

Make the ASSERT macro a bit more reusable.

* tests/macros.h (ASSERT): Depend on ASSERT_STREAM.
(ASSERT_STREAM): Provide default of stderr.
* tests/test-dirent-safer.c: Include macros.h, using alternate
stream for assertions.
* tests/test-dup-safer.c: Likewise.
* tests/test-freopen-safer.c: Likewise.
* tests/test-getopt.c: Likewise.
* tests/test-openat-safer.c: Likewise.
* tests/test-pipe.c: Likewise.
* tests/test-popen-safer.c: Likewise.
* modules/dirent-safer-tests (Files): Include macros.h.
* modules/unistd-safer-tests (Files): Likewise.
* modules/freopen-safer-tests (Files): Likewise.
* modules/getopt-posix-tests (Files): Likewise.
* modules/openat-safer-tests (Files): Likewise.
* modules/pipe-tests (Files): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agojavacomp: Portability fix.
Bruno Haible [Sat, 26 Dec 2009 15:24:16 +0000 (16:24 +0100)]
javacomp: Portability fix.

14 years agolocalename: Fix storage allocation of gl_locale_name_thread's result.
Bruno Haible [Sat, 26 Dec 2009 13:30:21 +0000 (14:30 +0100)]
localename: Fix storage allocation of gl_locale_name_thread's result.

14 years agolocalename: Fix unit test.
Bruno Haible [Sat, 26 Dec 2009 13:27:03 +0000 (14:27 +0100)]
localename: Fix unit test.

14 years agoisdir: complete the removal of m4/isdir.m4
Jim Meyering [Sat, 26 Dec 2009 10:01:59 +0000 (11:01 +0100)]
isdir: complete the removal of m4/isdir.m4

* modules/isdir (configure.ac): Remove reference to gl_ISDIR.

14 years agoisdir: clean up, since at least grep still uses it
Jim Meyering [Sat, 26 Dec 2009 08:56:23 +0000 (09:56 +0100)]
isdir: clean up, since at least grep still uses it

* lib/isdir.c: Include "isdir.h".
(S_ISDIR): Remove now-unneeded definition.
* modules/isdir (Files): Add lib/isdir.h.
* lib/isdir.h: New file, with declaration.
* m4/isdir.m4: Remove file -- unneeded.

14 years agoautoupdate
Karl Berry [Fri, 25 Dec 2009 15:02:05 +0000 (07:02 -0800)]
autoupdate

14 years agoselinux-h: Make generated .h files standalone.
Bruno Haible [Fri, 25 Dec 2009 12:51:48 +0000 (13:51 +0100)]
selinux-h: Make generated .h files standalone.

14 years agoMove gl_FCNTL_O_FLAGS to a separate .m4 file.
Bruno Haible [Fri, 25 Dec 2009 12:12:51 +0000 (13:12 +0100)]
Move gl_FCNTL_O_FLAGS to a separate .m4 file.

14 years agoopenat: Fix warning.
Bruno Haible [Fri, 25 Dec 2009 10:49:24 +0000 (11:49 +0100)]
openat: Fix warning.

14 years agoNew module 'unused-parameter'.
Bruno Haible [Fri, 25 Dec 2009 01:43:41 +0000 (02:43 +0100)]
New module 'unused-parameter'.

14 years agoAdd missing dependencies to 'extensions' module.
Bruno Haible [Fri, 25 Dec 2009 00:44:29 +0000 (01:44 +0100)]
Add missing dependencies to 'extensions' module.

14 years agobinary-io: Avoid gcc warning due to SET_BINARY.
Bruno Haible [Thu, 24 Dec 2009 21:16:51 +0000 (22:16 +0100)]
binary-io: Avoid gcc warning due to SET_BINARY.

14 years agoAvoid future namespace pollution on glibc systems.
Bruno Haible [Thu, 24 Dec 2009 20:46:04 +0000 (21:46 +0100)]
Avoid future namespace pollution on glibc systems.

14 years agoRefactor common macros used in tests.
Bruno Haible [Thu, 24 Dec 2009 20:01:42 +0000 (21:01 +0100)]
Refactor common macros used in tests.

14 years agoFix indentation.
Bruno Haible [Thu, 24 Dec 2009 19:29:33 +0000 (20:29 +0100)]
Fix indentation.

14 years agotest-nanosleep: fix typo
Eric Blake [Thu, 24 Dec 2009 19:00:23 +0000 (12:00 -0700)]
test-nanosleep: fix typo

* tests/test-nanosleep.c (SIGNATURE_CHECK): Fix typo in previous
patch.
Reported by Bruno Haible.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agoReorder file list.
Bruno Haible [Thu, 24 Dec 2009 17:15:55 +0000 (18:15 +0100)]
Reorder file list.

14 years agoReorder file list.
Bruno Haible [Thu, 24 Dec 2009 17:12:39 +0000 (18:12 +0100)]
Reorder file list.

14 years agoReduce namespace pollution on glibc systems.
Bruno Haible [Thu, 24 Dec 2009 15:59:36 +0000 (16:59 +0100)]
Reduce namespace pollution on glibc systems.

14 years agoFix typo in today's commit.
Bruno Haible [Thu, 24 Dec 2009 15:30:21 +0000 (16:30 +0100)]
Fix typo in today's commit.

14 years agotests: add signature checks
Eric Blake [Tue, 22 Dec 2009 17:57:14 +0000 (10:57 -0700)]
tests: add signature checks

These tests will help catch problems similar to the one recently
fixed for cygwin declaring getsubopt and symlinkat in the wrong header.

* tests/signature.h (SIGNATURE_CHECK): New file.
* modules/atexit-tests (Files): Use it.
* modules/btowc-tests (Files): Likewise.
* modules/canonicalize-lgpl-tests (Files): Likewise.
* modules/ceilf-tests (Files): Likewise.
* modules/ceill-tests (Files): Likewise.
* modules/chown-tests (Files): Likewise.
* modules/dprintf-posix-tests (Files): Likewise.
* modules/dup2-tests (Files): Likewise.
* modules/dup3-tests (Files): Likewise.
* modules/duplocale-tests (Files): Likewise.
* modules/fchdir-tests (Files): Likewise.
* modules/fcntl-tests (Files): Likewise.
* modules/fdopendir-tests (Files): Likewise.
* modules/fflush-tests (Files): Likewise.
* modules/flock-tests (Files): Likewise.
* modules/floorf-tests (Files): Likewise.
* modules/floorl-tests (Files): Likewise.
* modules/fnmatch-tests (Files): Likewise.
* modules/fopen-tests (Files): Likewise.
* modules/fprintf-posix-tests (Files): Likewise.
* modules/freopen-tests (Files): Likewise.
* modules/frexp-nolibm-tests (Files): Likewise.
* modules/frexp-tests (Files): Likewise.
* modules/frexpl-nolibm-tests (Files): Likewise.
* modules/frexpl-tests (Files): Likewise.
* modules/fseek-tests (Files): Likewise.
* modules/fseeko-tests (Files): Likewise.
* modules/fsync-tests (Files): Likewise.
* modules/ftell-tests (Files): Likewise.
* modules/ftello-tests (Files): Likewise.
* modules/futimens-tests (Files): Likewise.
* modules/getaddrinfo-tests (Files): Likewise.
* modules/getcwd-tests (Files): Likewise.
* modules/getdelim-tests (Files): Likewise.
* modules/getdtablesize-tests (Files): Likewise.
* modules/getgroups-tests (Files): Likewise.
* modules/gethostname-tests (Files): Likewise.
* modules/getline-tests (Files): Likewise.
* modules/getopt-posix-tests (Files): Likewise.
* modules/gettimeofday-tests (Files): Likewise.
* modules/glob-tests (Files): Likewise.
* modules/iconv-tests (Files): Likewise.
* modules/inet_ntop-tests (Files): Likewise.
* modules/inet_pton-tests (Files): Likewise.
* modules/isblank-tests (Files): Likewise.
* modules/lchown-tests (Files): Likewise.
* modules/ldexpl-tests (Files): Likewise.
* modules/link-tests (Files): Likewise.
* modules/linkat-tests (Files): Likewise.
* modules/lseek-tests (Files): Likewise.
* modules/lstat-tests (Files): Likewise.
* modules/mbrtowc-tests (Files): Likewise.
* modules/mbsinit-tests (Files): Likewise.
* modules/mbsnrtowcs-tests (Files): Likewise.
* modules/mbsrtowcs-tests (Files): Likewise.
* modules/memchr-tests (Files): Likewise.
* modules/memcmp-tests (Files): Likewise.
* modules/memmem-tests (Files): Likewise.
* modules/memrchr-tests (Files): Likewise.
* modules/mkdir-tests (Files): Likewise.
* modules/mkfifo-tests (Files): Likewise.
* modules/mkfifoat-tests (Files): Likewise.
* modules/mknod-tests (Files): Likewise.
* modules/nanosleep-tests (Files): Likewise.
* modules/nl_langinfo-tests (Files): Likewise.
* modules/obstack-printf-tests (Files): Likewise.
* modules/open-tests (Files): Likewise.
* modules/openat-tests (Files): Likewise.
* modules/perror-tests (Files): Likewise.
* modules/pipe2-tests (Files): Likewise.
* modules/poll-tests (Files): Likewise.
* modules/popen-tests (Files): Likewise.
* modules/posix_spawn-tests (Files): Likewise.
* modules/posix_spawnp-tests (Files): Likewise.
* modules/pread-tests (Files): Likewise.
* modules/printf-posix-tests (Files): Likewise.
* modules/pty-tests (Files): Likewise.
* modules/random_r-tests (Files): Likewise.
* modules/rawmemchr-tests (Files): Likewise.
* modules/readlink-tests (Files): Likewise.
* modules/remove-tests (Files): Likewise.
* modules/rename-tests (Files): Likewise.
* modules/renameat-tests (Files): Likewise.
* modules/rmdir-tests (Files): Likewise.
* modules/round-tests (Files): Likewise.
* modules/roundf-tests (Files): Likewise.
* modules/roundl-tests (Files): Likewise.
* modules/select-tests (Files): Likewise.
* modules/setenv-tests (Files): Likewise.
* modules/sigaction-tests (Files): Likewise.
* modules/sleep-tests (Files): Likewise.
* modules/snprintf-posix-tests (Files): Likewise.
* modules/snprintf-tests (Files): Likewise.
* modules/sprintf-posix-tests (Files): Likewise.
* modules/stat-tests (Files): Likewise.
* modules/strcasestr-tests (Files): Likewise.
* modules/strchrnul-tests (Files): Likewise.
* modules/strerror-tests (Files): Likewise.
* modules/strsignal-tests (Files): Likewise.
* modules/strstr-tests (Files): Likewise.
* modules/strtod-tests (Files): Likewise.
* modules/strverscmp-tests (Files): Likewise.
* modules/symlink-tests (Files): Likewise.
* modules/symlinkat-tests (Files): Likewise.
* modules/times-tests (Files): Likewise.
* modules/trunc-tests (Files): Likewise.
* modules/truncf-tests (Files): Likewise.
* modules/truncl-tests (Files): Likewise.
* modules/tsearch-tests (Files): Likewise.
* modules/uname-tests (Files): Likewise.
* modules/unlink-tests (Files): Likewise.
* modules/unsetenv-tests (Files): Likewise.
* modules/usleep-tests (Files): Likewise.
* modules/utimensat-tests (Files): Likewise.
* modules/vasprintf-tests (Files): Likewise.
* modules/vdprintf-posix-tests (Files): Likewise.
* modules/vfprintf-posix-tests (Files): Likewise.
* modules/vprintf-posix-tests (Files): Likewise.
* modules/vsnprintf-posix-tests (Files): Likewise.
* modules/vsnprintf-tests (Files): Likewise.
* modules/vsprintf-posix-tests (Files): Likewise.
* modules/wcrtomb-tests (Files): Likewise.
* modules/wcsnrtombs-tests (Files): Likewise.
* modules/wcsrtombs-tests (Files): Likewise.
* modules/wcwidth-tests (Files): Likewise.
* tests/test-isfinite.c (isfinite): Ensure macro declaration.
* tests/test-isinf.c (isinf): Likewise.
* tests/test-isnan.c (isnan): Likewise.
* tests/test-signbit.c (signbit): Likewise.
* tests/test-select.c (FD_CLR, FD_ISSET, FD_SET, FD_ZERO): Ensure
declaration, either as macro or with correct signature.
(select): Ensure function under test is declared with correct
signature in correct header.
* tests/test-atexit.c (atexit): Likewise.
* tests/test-btowc.c (btowc): Likewise.
* tests/test-canonicalize-lgpl.c (realpath)
(canonicalize_file_name): Likewise.
* tests/test-ceilf1.c (ceilf): Likewise.
* tests/test-ceill.c (ceill): Likewise.
* tests/test-chown.c (chown): Likewise.
* tests/test-dprintf-posix.c (dprintf): Likewise.
* tests/test-dup2.c (dup2): Likewise.
* tests/test-dup3.c (dup3): Likewise.
* tests/test-duplocale.c (duplocale): Likewise.
* tests/test-fchdir.c (fchdir): Likewise.
* tests/test-fchownat.c (fchownat): Likewise.
* tests/test-fcntl.c (fcntl): Likewise.
* tests/test-fdopendir.c (fdopendir): Likewise.
* tests/test-fflush.c (fflush): Likewise.
* tests/test-flock.c (flock): Likewise.
* tests/test-floorf1.c (floorf): Likewise.
* tests/test-floorl.c (floorl): Likewise.
* tests/test-fnmatch.c (fnmatch): Likewise.
* tests/test-fopen.c (fopen): Likewise.
* tests/test-fprintf-posix.c (fprintf): Likewise.
* tests/test-freopen.c (freopen): Likewise.
* tests/test-frexp.c (frexp): Likewise.
* tests/test-frexpl.c (frexpl): Likewise.
* tests/test-fseek.c (fseek): Likewise.
* tests/test-fseeko.c (fseeko): Likewise.
* tests/test-fstatat.c (fstatat): Likewise.
* tests/test-fsync.c (fsync): Likewise.
* tests/test-ftell.c (ftell): Likewise.
* tests/test-ftello.c (ftello): Likewise.
* tests/test-futimens.c (futimens): Likewise.
* tests/test-getaddrinfo.c (getaddrinfo, freeaddrinfo)
(gai_strerror): Likewise.
* tests/test-getcwd.c (getcwd): Likewise.
* tests/test-getdelim.c (getdelim): Likewise.
* tests/test-getdtablesize.c (getdtablesize): Likewise.
* tests/test-getgroups.c (getgroups): Likewise.
* tests/test-gethostname.c (gethostname): Likewise.
* tests/test-getline.c (getline): Likewise.
* tests/test-getopt.c (getopt, getopt_long, getopt_long_only):
Likewise.
* tests/test-gettimeofday.c (gettimeofday): Likewise.
* tests/test-glob.c (glob, globfree): Likewise.
* tests/test-iconv.c (iconv, iconv_open, iconv_close): Likewise.
* tests/test-inet_ntop.c (inet_ntop): Likewise.
* tests/test-inet_pton.c (inet_pton): Likewise.
* tests/test-isblank.c (isblank): Likewise.
* tests/test-lchown.c (lchown): Likewise.
* tests/test-ldexpl.c (ldexpl): Likewise.
* tests/test-link.c (link): Likewise.
* tests/test-linkat.c (linkat): Likewise.
* tests/test-lseek.c (lseek): Likewise.
* tests/test-lstat.c (lstat): Likewise.
* tests/test-mbrtowc.c (mbrtowc): Likewise.
* tests/test-mbsinit.c (mbsinit): Likewise.
* tests/test-mbsnrtowcs.c (mbsnrtowcs): Likewise.
* tests/test-mbsrtowcs.c (mbsrtowcs): Likewise.
* tests/test-memchr.c (memchr): Likewise.
* tests/test-memcmp.c (memcmp): Likewise.
* tests/test-memmem.c (memmem): Likewise.
* tests/test-memrchr.c (memrchr): Likewise.
* tests/test-mkdir.c (mkdir): Likewise.
* tests/test-mkdirat.c (mkdirat): Likewise.
* tests/test-mkfifo.c (mkfifo): Likewise.
* tests/test-mkfifoat.c (mkfifoat, mknodat): Likewise.
* tests/test-mknod.c (mknod): Likewise.
* tests/test-nanosleep.c (nanosleep): Likewise.
* tests/test-nl_langinfo.c (nl_langinfo): Likewise.
* tests/test-obstack-printf.c (obstack_printf, obstack_vprintf):
Likewise.
* tests/test-open.c (open): Likewise.
* tests/test-openat.c (openat): Likewise.
* tests/test-perror.c (perror): Likewise.
* tests/test-pipe2.c (pipe2): Likewise.
* tests/test-poll.c (poll): Likewise.
* tests/test-popen.c (popen, pclose): Likewise.
* tests/test-posix_spawn1.c (posix_spawnp, posix_spawnattr_init)
(posix_spawnattr_destroy, posix_spawnattr_setsigmask)
(posix_spawnattr_setflags, posix_spawn_file_actions_init)
(posix_spawn_file_actions_destroy)
(posix_spawn_file_actions_addclose)
(posix_spawn_file_actions_addopen)
(posix_spawn_file_actions_adddup2): Likewise.
* tests/test-posix_spawn3.c (posix_spawn): Likewise.
* tests/test-pread.c (pread): Likewise.
* tests/test-printf-posix.c (printf): Likewise.
* tests/test-pty.c (openpty, forkpty): Likewise.
* tests/test-random_r.c (srandom_r, initstate_r, setstate_r)
(random_r): Likewise.
* tests/test-rawmemchr.c (rawmemchr): Likewise.
* tests/test-readlink.c (readlink): Likewise.
* tests/test-remove.c (remove): Likewise.
* tests/test-rename.c (rename): Likewise.
* tests/test-renameat.c (renameat): Likewise.
* tests/test-rmdir.c (rmdir): Likewise.
* tests/test-round1.c (round): Likewise.
* tests/test-roundf1.c (roundf): Likewise.
* tests/test-roundl.c (roundl): Likewise.
* tests/test-setenv.c (setenv): Likewise.
* tests/test-sigaction.c (sigaction): Likewise.
* tests/test-sleep.c (sleep): Likewise.
* tests/test-snprintf.c (snprintf): Likewise.
* tests/test-sprintf-posix.c (sprintf): Likewise.
* tests/test-stat.c (stat): Likewise.
* tests/test-stpncpy.c (stpncpy): Likewise.
* tests/test-strcasestr.c (strcasestr): Likewise.
* tests/test-strchrnul.c (strchrnul): Likewise.
* tests/test-strerror.c (strerror): Likewise.
* tests/test-strsignal.c (strsignal): Likewise.
* tests/test-strstr.c (strstr): Likewise.
* tests/test-strtod.c (strtod): Likewise.
* tests/test-strverscmp.c (strverscmp): Likewise.
* tests/test-symlink.c (symlink): Likewise.
* tests/test-symlinkat.c (symlinkat, readlinkat): Likewise.
* tests/test-times.c (times): Likewise.
* tests/test-trunc1.c (trunc): Likewise.
* tests/test-truncf1.c (truncf): Likewise.
* tests/test-truncl.c (truncl): Likewise.
* tests/test-tsearch.c (tdelete, tfind, tsearch, twalk):
Likewise.
* tests/test-uname.c (uname): Likewise.
* tests/test-unlink.c (unlink): Likewise.
* tests/test-unlinkat.c (unlinkat): Likewise.
* tests/test-unsetenv.c (unsetenv): Likewise.
* tests/test-usleep.c (usleep): Likewise.
* tests/test-utimensat.c (utimensat): Likewise.
* tests/test-vasprintf.c (asprintf, vasprintf): Likewise.
* tests/test-vdprintf-posix.c (vdprintf): Likewise.
* tests/test-vfprintf-posix.c (vfprintf): Likewise.
* tests/test-vprintf-posix.c (vprintf): Likewise.
* tests/test-vsnprintf.c (vsnprintf): Likewise.
* tests/test-vsprintf-posix.c (vsprintf): Likewise.
* tests/test-wcrtomb.c (wcrtomb): Likewise.
* tests/test-wcsnrtombs.c (wcsnrtombs): Likewise.
* tests/test-wcsrtombs.c (wcsrtombs): Likewise.
* tests/test-wcwidth.c (wcwidth): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agobuild: pull in conditional headers during GNULIB_POSIXCHECK
Eric Blake [Thu, 24 Dec 2009 13:01:43 +0000 (06:01 -0700)]
build: pull in conditional headers during GNULIB_POSIXCHECK

Any time we conditionally include a header in order to satisfy
prerequisites of one module, we must also include that header
under GNULIB_POSIXCHECK to avoid compilation errors if that
module is not in use.  If this is not done, then our link warning
override can occur before the system's declaration, which
causes a syntax error when the system header is finally included.

* lib/stdio.in.h (includes): Using GNULIB_POSIXCHECK also requires
definitions from any conditionally-included headers.
* lib/stdlib.in.h (includes): Likewise.
* lib/unistd.in.h (includes): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agoInclude header file being tested immediately after config.h.
Bruno Haible [Thu, 24 Dec 2009 12:48:40 +0000 (13:48 +0100)]
Include header file being tested immediately after config.h.

14 years agounistd: work around cygwin bug
Eric Blake [Thu, 24 Dec 2009 01:42:59 +0000 (18:42 -0700)]
unistd: work around cygwin bug

Cygwin 1.7.1 placed symlinkat and unlinkat in the wrong headers
(due to a bug in the Linux man pages).

* lib/unistd.in.h (includes): Pick up headers needed for cygwin.
* doc/posix-functions/unlinkat.texi (unlinkat): Document the bug.
* doc/posix-functions/symlinkat.texi (symlinkat): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agolocalename: more tests
Bruno Haible [Wed, 23 Dec 2009 14:27:28 +0000 (15:27 +0100)]
localename: more tests

14 years agolocalename: Make aware of thread locale.
Bruno Haible [Wed, 23 Dec 2009 14:23:48 +0000 (15:23 +0100)]
localename: Make aware of thread locale.

14 years agova-args: new module
Eric Blake [Tue, 15 Dec 2009 13:59:43 +0000 (06:59 -0700)]
va-args: new module

* modules/va-args: New file.
* m4/va-args.m4 (gl_VA_ARGS): Likewise.
* MODULES.html.sh (Core language properties): Mention it.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agognulib-common: prefer _GL_UNUSED over _UNUSED_PARAMETER_
Eric Blake [Tue, 22 Dec 2009 22:14:49 +0000 (15:14 -0700)]
gnulib-common: prefer _GL_UNUSED over _UNUSED_PARAMETER_

There are more contexts where __attribute__((__unused__)) is
useful than just parameter lists.  Also, naming the macro
_GL_UNUSED fits with the recent addition of _GL_ARG_NONNULL.
Preserve the name _UNUSED_PARAMETER_ for backwards-compatible
use in external projects.

* m4/gnulib-common.m4 (gl_COMMON): Create a more-appropriately
named alias for __attribute__((__unused__)).
* lib/chown.c: Update client.
* lib/fchmodat.c: Likewise.
* lib/fts.c: Likewise.
* lib/getdate.y: Likewise.
* lib/getgroups.c: Likewise.
* lib/getopt.c: Likewise.
* lib/getugroups.c: Likewise.
* lib/mkdir.c: Likewise.
* lib/mkfifo.c: Likewise.
* lib/mkfifoat.c: Likewise.
* lib/mknod.c: Likewise.
* lib/mknodat.c: Likewise.
* lib/readlink.c: Likewise.
* lib/se-context.in.h: Likewise.
* lib/se-selinux.in.h: Likewise.
* lib/sockets.c: Likewise.
* lib/symlink.c: Likewise.
* lib/symlinkat.c: Likewise.
* lib/unicodeio.c: Likewise.
* lib/unistr.h: Likewise.
* tests/test-areadlink.c: Likewise.
* tests/test-areadlinkat.c: Likewise.
* tests/test-filenamecat.c: Likewise.
* tests/test-fseeko.c: Likewise.
* tests/test-ftello.c: Likewise.
* tests/test-getdate.c: Likewise.
* tests/test-getgroups.c: Likewise.
* tests/test-gethostname.c: Likewise.
* tests/test-quotearg.c: Likewise.
* tests/test-version-etc.c: Likewise.
* tests/test-xalloc-die.c: Likewise.
* tests/test-xfprintf-posix.c: Likewise.
* tests/test-xprintf-posix.c: Likewise.
* tests/test-xvasprintf.c: Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agotests: avoid compiler warnings
Eric Blake [Tue, 22 Dec 2009 22:03:48 +0000 (15:03 -0700)]
tests: avoid compiler warnings

Silence more warnings during coreutils build.

* tests/test-fcntl.c (main): Delete unused parameters.
* tests/test-freopen-safer.c (main): Likewise.
* tests/test-xalloc-die.c (main): Mark unused parameters.
* tests/test-fseeko.c (main): Likewise.
* tests/test-ftello.c (main): Likewise.
* tests/test-nanosleep.c (main): Avoid declaration warning.
* tests/test-sleep.c (main): Likewise.
* tests/test-unsetenv.c (main): Silence warning about string
literal.
* m4/setenv.m4 (gl_FUNC_UNSETENV): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agoMore localename tests.
Bruno Haible [Wed, 23 Dec 2009 12:30:50 +0000 (13:30 +0100)]
More localename tests.

14 years agounistd: Ensure getcwd gets declared before being overridden.
Bruno Haible [Wed, 23 Dec 2009 09:59:14 +0000 (10:59 +0100)]
unistd: Ensure getcwd gets declared before being overridden.

14 years agowchar: Diagnose broken combination of glibc and gcc versions and flags.
Bruno Haible [Wed, 23 Dec 2009 02:41:34 +0000 (03:41 +0100)]
wchar: Diagnose broken combination of glibc and gcc versions and flags.

14 years agomath, unistd: avoid redundant includes
Eric Blake [Mon, 21 Dec 2009 18:32:58 +0000 (11:32 -0700)]
math, unistd: avoid redundant includes

* lib/math.in.h (isnan): No need to re-include <math.h>.
* lib/unistd.in.h (getcwd): Likewise, for <stdlib.h>.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agogetsubopt: work around cygwin bug
Eric Blake [Mon, 21 Dec 2009 18:14:18 +0000 (11:14 -0700)]
getsubopt: work around cygwin bug

On cygwin, compiling with -DGNULIB_POSIXCHECK failed because
the getsubopt link warning definition interfered with the
inclusion of the system header.  The fix, as always in these
types of problems, is to ensure that system headers are
completely included before doing any overrides.

* lib/stdlib.in.h (includes): Move unistd inclusion sooner, to
avoid conflicting with system getsubopt.
* doc/posix-functions/getsubopt.texi (getsubopt): Document the
bug.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agogetopt: synchronize from glibc
Eric Blake [Wed, 16 Dec 2009 19:03:14 +0000 (12:03 -0700)]
getopt: synchronize from glibc

Make gnulib closer to glibc, to make tracking it easier to track
extent of pending patches against glibc.

* lib/getopt.c (_getopt_initialize, _getopt_internal_r): Swap
parameter order.  Adjust all callers.
(_getopt_internal_r, main): Adjust quoting in error messages.
Drop considerations for outdated POSIX 1003.2 error message.
* lib/getopt1.c (_getopt_long_r, _getopt_long_only_r): Adjust
callers.
* lib/getopt_int.h (_getopt_internal_r): Adjust prototype.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agotest-getopt: test stderr behavior
Eric Blake [Wed, 2 Dec 2009 22:48:08 +0000 (15:48 -0700)]
test-getopt: test stderr behavior

Portions of this commit are commented out because they tickle
glibc bugs.  For a real-life example of the bug:

$ env -ua -:
env: invalid option -- :
Try `env --help' for more information.
$ env -:
env: invalid option -- :
Try `env --help' for more information.
$ env -+
env: invalid option -- +
Try `env --help' for more information.
$ env -ua -+
Try `env --help' for more information.

Notice that when -+ is not given as the first argument, the
error message is mistakenly suppressed.

* modules/getopt-posix-tests (Depends-on): Add dup2.
* tests/test-getopt.c (ASSERT): Avoid stderr.
(main): Move stderr to a temporary file.
* tests/test-getopt.h (getopt_loop): No longer manipulate opterr.
Instead, add parameter to inform caller if output occurred.
(test_getopt): Adjust all tests to expect silence, and add new
tests of leading ":".
* doc/glibc-functions/getopt_long.texi (getopt_long): Document
glibc shortcomings with leading "-:" or "+:" in optstring.
* doc/glibc-functions/getopt_long_only.texi (getopt_long_only):
Likewise.
* doc/posix-functions/getopt.texi (getopt): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agotest-getopt: enhance test
Eric Blake [Wed, 2 Dec 2009 00:21:34 +0000 (17:21 -0700)]
test-getopt: enhance test

Add coverage of optind==0 for getopt_long, since coreutils
depends on it.  Also test an optstring containing "W;", since
that tends to expose corner-case bugs (even in glibc, so the
test is weaker than it could be).

* m4/getopt.m4 (gl_GETOPT_CHECK_HEADERS): Require that getopt_long
supports optind=0.
* tests/test-getopt.c (OPTIND_MIN): Move...
* tests/test-getopt.h (OPTIND_MIN): ...here.
* tests/test-getopt_long.h (test_getopt_long): Add more coverage.
Require that optind=0 works, since modern BSD supports it in
addition to optreset, and since coreutils expects it.
(test_getopt_long_only): New test.
* doc/glibc-functions/getopt_long.texi (getopt_long): Document
glibc shortcomings with 'W;', and enforcement of optind=0.
* doc/glibc-functions/getopt_long_only.texi (getopt_long_only):
Likewise.

14 years agoTweak last commit.
Bruno Haible [Tue, 22 Dec 2009 00:58:14 +0000 (01:58 +0100)]
Tweak last commit.

14 years agolocalename: Improvements for MacOS X and Cygwin.
Bruno Haible [Tue, 22 Dec 2009 00:35:04 +0000 (01:35 +0100)]
localename: Improvements for MacOS X and Cygwin.

14 years agolocalename: Update list of Win32 locale ids.
Bruno Haible [Tue, 22 Dec 2009 00:08:25 +0000 (01:08 +0100)]
localename: Update list of Win32 locale ids.

14 years agotest-utimens: avoid spurious failure
Eric Blake [Mon, 21 Dec 2009 14:00:13 +0000 (07:00 -0700)]
test-utimens: avoid spurious failure

Fixes a spurious failure on ext3, with one-second resolution,
now that ctime effects are being tested for inequality.

* tests/test-chown.h (nap): Factor...
* tests/nap.h: ...into new file.
* tests/test-lchown.h (nap): Avoid duplication.
* tests/test-utimens-common.h (nap): Use shared implementation,
necessary on file systems with 1-second resolution.
* modules/chown-tests (Files): Include new file.
* modules/fdutimensat-tests (Files): Likewise.
* modules/futimens-tests (Files): Likewise.
* modules/lchown-tests (Files): Likewise.
* modules/openat-tests (Files): Likewise.
* modules/utimens-tests (Files): Likewise.
* modules/utimensat-tests (Files): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agofutimens, utimensat: work around Linux bug
Eric Blake [Thu, 17 Dec 2009 14:32:00 +0000 (07:32 -0700)]
futimens, utimensat: work around Linux bug

futimens is trivial - let fdutimens do the work.  utimensat
is tougher: we don't want to call into local_utimensat,
because that can cause unnecessary chdir.  So we have to
repeat the logic from utimens.c.

* m4/futimens.m4 (gl_FUNC_FUTIMENS): Detect ctime bug.
* m4/utimensat.m4 (gl_FUNC_UTIMENSAT): Likewise.
* lib/utimensat.c (rpl_utimensat): Work around it.
* lib/futimens.c (rpl_futimens): Adjust comment.

14 years agoutimens: work around Linux ctime bug
Eric Blake [Thu, 17 Dec 2009 23:57:37 +0000 (16:57 -0700)]
utimens: work around Linux ctime bug

Force a ctime update by using stat() before any utimensat call
with mtime of UTIME_OMIT.  But avoid extra stat()s in later
calls, by doing extra work on the first instance in order to
cache whether the bug is actually present.

* lib/utimens.c (detect_ctime_bug): New helper function.
(update_timespec): Differentiate between workaround needed for
this bug vs. what is needed for systems that lack utimensat.
(fdutimens, lutimens): Work around bug.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agoutimens: check for ctime update
Eric Blake [Thu, 17 Dec 2009 19:30:47 +0000 (12:30 -0700)]
utimens: check for ctime update

futimens/utimensat on Linux fails to bump ctime if mtime is
UTIME_OMIT and atime is specified.

* tests/test-utimens-common.h (check_ctime): Define.
* tests/test-utimens.h (test_utimens): Expose the Linux bug.
* tests/test-futimens.h (test_futimens): Likewise.
* tests/test-lutimens.h (test_lutimens): Likewise.
* doc/posix-functions/futimens.texi (futimens): Document the bug.
* doc/posix-functions/utimensat.texi (utimensat): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agoCorrect position of 'Applicability' section.
Bruno Haible [Sat, 19 Dec 2009 21:44:53 +0000 (22:44 +0100)]
Correct position of 'Applicability' section.

14 years agodprintf-posix: Check against memory leak fixed on 2009-12-15.
Bruno Haible [Sat, 19 Dec 2009 21:17:02 +0000 (22:17 +0100)]
dprintf-posix: Check against memory leak fixed on 2009-12-15.

14 years agofprintf-posix: Check against memory leak fixed on 2009-12-15.
Bruno Haible [Sat, 19 Dec 2009 21:15:32 +0000 (22:15 +0100)]
fprintf-posix: Check against memory leak fixed on 2009-12-15.

14 years agodirfd: fix prototype
Eric Blake [Sat, 19 Dec 2009 18:49:32 +0000 (11:49 -0700)]
dirfd: fix prototype

Fix prototype to match POSIX.

* lib/dirent.in.h (dirfd): Argument is not const, per POSIX.
* lib/dirfd.c (dirfd): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agocanonicalize: reduce memory usage
Eric Blake [Sat, 19 Dec 2009 16:28:36 +0000 (09:28 -0700)]
canonicalize: reduce memory usage

canonicalize was returning a 4k buffer for everything, even though
the majority of canonical path names are much shorter.  This
resulted in a lot of unused memory, which in turn made tar run
out of memory when tracking a lot of files:
http://lists.gnu.org/archive/html/bug-tar/2009-12/msg00011.html

* lib/canonicalize.c (canonicalize_filename_mode): Trim the
allocation to size.
Reported by Solar Designer <solar@openwall.com>.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agoNew module attribute 'Applicability'.
Bruno Haible [Sat, 19 Dec 2009 14:27:58 +0000 (15:27 +0100)]
New module attribute 'Applicability'.

14 years agofflush: tweak
Bruno Haible [Sat, 19 Dec 2009 11:30:24 +0000 (12:30 +0100)]
fflush: tweak

14 years agoFix typo in comment.
José E. Marchesi [Sat, 19 Dec 2009 10:06:10 +0000 (11:06 +0100)]
Fix typo in comment.

14 years agofcntl: use to simplify other modules
Eric Blake [Wed, 16 Dec 2009 17:07:13 +0000 (10:07 -0700)]
fcntl: use to simplify other modules

Let fcntl do the work, instead of copying code into other modules.

* modules/cloexec (Depends-on): Add fcntl.
* modules/fchdir (Depends-on): Likewise.
* modules/fd-safer-flag (Depends-on): Likewise.
* modules/unistd-safer (Depends-on): Likewise.
* modules/dup3 (configure.ac): Set module indicator.
* m4/fchdir.m4 (gl_FUNC_FCHDIR): Replace fcntl if fchdir is
missing.
* lib/fchdir.c (_gl_register_dup): Fix comment.
* lib/cloexec.c (dup_cloexec): Simplify, by relying on fcntl.
* lib/dup-safer.c (dup_safer): Likewise.
* lib/dup-safer-flag.c (dup_safer_flag): Likewise.
* lib/dup3.c (dup3): Likewise.
* tests/test-fchdir.c (main): Enhance test.
Fixes a dup_cloexec bug reported by Ondřej Vašík.

Signed-off-by: Eric Blake <ebb9@byu.net>