2009-10-22 Pádraig Brady
Use a better IO block size for modern systems
* lib/copy-file.c (copy_file_preserving): Used a 32KiB malloced buffer.
* lib/md2.c: Likewise.
* lib/md4.c: Likewise.
* lib/md5.c: Likewise.
* lib/sha1.c: Likewise.
* lib/sha256.c: Likewise.
* lib/sha512.c: Likewise.
2009-10-22 Eric Blake
tests: avoid several compiler warnings
* tests/test-getcwd.c (main): Avoid buffer underflow.
* tests/test-getdate.c (main): String literals are not safe with
putenv, so use setenv. Declare unused argument.
* modules/getdate-tests (Depends-on): Add setenv.
* tests/test-argv-iter.c (main): Declare unused argument. Avoid
problems with string literals in char *.
* tests/test-hash.c (main): Avoid shadowing declaration.
(insert_new): Treat string literals as char const *.
* tests/test-getopt.h (test_getopt): Likewise.
(getopt_loop): Alter types to minimize casting elsewhere.
* tests/test-getopt_long.h (test_getopt_long, getopt_long_loop)
(test_getopt_long_posix): Likewise.
(do_getopt_long): Add wrapper to minimize casting.
* tests/test-atexit.c (clear_temp_file): Use void.
* tests/test-areadlink-with-size.c (main): Declare unused
arguments.
* 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-dirent-safer.c (main): Likewise.
* tests/test-dirname.c (main): Likewise.
* tests/test-dup2.c (main): Likewise.
* tests/test-fchdir.c (main): Likewise.
* tests/test-fcntl-h.c (main): Likewise.
* tests/test-fcntl-safer.c (main): Likewise.
* tests/test-fdopendir.c (main): Likewise.
* tests/test-fdutimensat.c (main): Likewise.
* tests/test-fflush.c (main): Likewise.
* tests/test-filenamecat.c (main): Likewise.
* tests/test-filevercmp.c (main): Likewise.
* tests/test-fopen-safer.c (main): Likewise.
* tests/test-fopen.c (main): Likewise.
* tests/test-fpending.c (main): Likewise.
* tests/test-fpurge.c (main): Likewise.
* tests/test-freading.c (main): Likewise.
* tests/test-fstatat.c (main): Likewise.
* tests/test-fsync.c (main): Likewise.
* tests/test-futimens.c (main): Likewise.
* tests/test-getndelim2.c (main): Likewise.
* tests/test-gettimeofday.c (main): Likewise.
* tests/test-getopt.c (main): Likewise.
* tests/test-i-ring.c (main): Likewise.
* tests/test-inttypes.c (main): Likewise.
* tests/test-link.c (main): Likewise.
* tests/test-lstat.c (main): Likewise.
* tests/test-math.c (main): Likewise.
* tests/test-md5.c (main): Likewise.
* tests/test-memchr2.c (main): Likewise.
* tests/test-memrchr.c (main): Likewise.
* tests/test-mkdir.c (main): Likewise.
* tests/test-mkdirat.c (main): Likewise.
* tests/test-mkfifoat.c (main): Likewise.
* tests/test-open.c (main): Likewise.
* tests/test-openat-safer.c (main): Likewise.
* tests/test-openat.c (main): Likewise.
* tests/test-quotearg.c (main): Likewise.
* tests/test-rawmemchr.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-rmdir.c (main): Likewise.
* tests/test-sha1.c (main): Likewise.
* tests/test-signal.c (main): Likewise.
* tests/test-sigaction.c (main): Likewise.
* tests/test-stat.c (main): Likewise.
* tests/test-stat-time.c (main): Likewise.
* tests/test-stddef.c (main): Likewise.
* tests/test-stdint.c (main): Likewise.
* tests/test-stdio.c (main): Likewise.
* tests/test-stdlib.c (main): Likewise.
* tests/test-strchrnul.c (main): Likewise.
* tests/test-strerror.c (main): Likewise.
* tests/test-string.c (main): Likewise.
* tests/test-strtod.c (main): Likewise.
* tests/test-strverscmp.c (main): Likewise.
* tests/test-symlink.c (main): Likewise.
* tests/test-symlinkat.c (main): Likewise.
* tests/test-sys_stat.c (main): Likewise.
* tests/test-sys_time.c (main): Likewise.
* tests/test-time.c (main): Likewise.
* tests/test-unistd.c (main): Likewise.
* tests/test-unlink.c (main): Likewise.
* tests/test-unlinkat.c (main): Likewise.
* tests/test-utimens.c (main): Likewise.
* tests/test-utimensat.c (main): Likewise.
* tests/test-version-etc.c (main): Likewise.
* tests/test-wchar.c (main): Likewise.
* tests/test-wctype.c (main): Likewise.
* tests/test-xprintf-posix.c (main): Likewise.
* tests/test-posixtm.c (main): Likewise.
(STREQ): Delete unused macro.
* tests/test-linkat.c (main): Declare unused arguments. Avoid
shadowed variables.
* tests/test-memchr.c (main): Likewise.
2009-10-21 Eric Blake
areadlinkat: avoid failure on older glibc
* lib/at-func.c (AT_FUNC_NAME): Check for explicit FUNC_FAIL,
rather than mis-comparing 0 against FUNC_RESULT of char*.
2009-10-21 Bruno Haible
* modules/stpncpy (License): Relicense under LGPLv2+.
Reported by David Lutterkort .
2009-10-20 Eric Blake
utimensat: work around Solaris 9 bug
* lib/utimens.c (fdutimens, lutimens): Force a stat if platform
has trailing slash bugs.
* tests/test-lutimens.h (test_lutimens): Enhance test.
* tests/test-utimens.h (test_utimens): Likewise.
* doc/posix-functions/utime.texi (utime): Enhance documentation.
* doc/posix-functions/utimes.texi (utimes): Likewise.
* doc/posix-functions/utimensat.texi (utimensat): Likewise.
* doc/glibc-functions/futimesat.texi (futimesat): Likewise.
* doc/glibc-functions/lutimes.texi (lutimes): Likewise.
* doc/posix-functions/futimens.texi (futimens): Likewise.
fdutimensat: new module
* modules/fdutimensat: New file.
* lib/fdutimensat.c (fdutimensat): Likewise.
* lib/utimens.h (fdutimensat, lutimensat): Declare new functions.
* MODULES.html.sh (File system functions): Mention module.
* modules/fdutimensat-tests: New test.
* tests/test-fdutimensat.c: Likewise.
doc: regenerate INSTALL
* doc/INSTALL: Reflect recent autoconf update.
* doc/INSTALL.ISO: Likewise.
* doc/INSTALL.UTF-8: Likewise.
2009-10-20 Pádraig Brady
acl: warn if ACL support is not detected
* m4/acl.m4 (gl_FUNC_ACL): Output a warning if ACL support is not found.
2009-10-19 Giuseppe Scrivano
* lib/nproc.h: Add extern "C" block for C++.
2009-10-18 Reuben Thomas
Bruno Haible
* doc/posix-functions/isascii.texi: Document the 2 alternative APIs.
* doc/posix-functions/isalnum.texi: Document the 4 alternative APIs.
* doc/posix-functions/isalpha.texi: Likewise.
* doc/posix-functions/isblank.texi: Likewise.
* doc/posix-functions/iscntrl.texi: Likewise.
* doc/posix-functions/isdigit.texi: Likewise.
* doc/posix-functions/isgraph.texi: Likewise.
* doc/posix-functions/islower.texi: Likewise.
* doc/posix-functions/isprint.texi: Likewise.
* doc/posix-functions/ispunct.texi: Likewise.
* doc/posix-functions/isspace.texi: Likewise.
* doc/posix-functions/isupper.texi: Likewise.
* doc/posix-functions/isxdigit.texi: Likewise.
2009-10-18 Bruno Haible
Tests for module 'isblank'.
* modules/isblank-tests: New file.
* tests/test-isblank.c: New file.
New module 'isblank'.
* lib/isblank.c: New file.
* m4/isblank.m4: New file.
* modules/isblank: New file.
* doc/posix-functions/isblank.texi: Mention the new module.
2009-10-18 Bruno Haible
New module 'ctype'.
* lib/ctype.in.h: New file.
* m4/ctype.m4: New file.
* modules/ctype: New file.
* doc/posix-headers/ctype.texi: Mention the new module.
2009-10-18 Jim Meyering
m4: stylistic-only: hoist AC_SUBST to be adjacent to initialization
Declare a variable like LIB_CLOCK_GETTIME to be AC_SUBSTituted
right after its initialization, rather than farther down.
Keeping these in close proximity makes it easier to ensure
that each such variable is initialized. E.g.,
LIB_CLOCK_GETTIME=
AC_SUBST([LIB_CLOCK_GETTIME])
This change also increments these serial numbers.
* m4/clock_time.m4 (gl_CLOCK_TIME): Hoist AC_SUBST use.
* m4/euidaccess.m4 (gl_PREREQ_EUIDACCESS): Likewise.
* m4/nanosleep.m4 (gl_FUNC_NANOSLEEP): Likewise.
2009-10-18 Bruno Haible
Don't let environment variables perturb build.
* m4/gethrxtime.m4 (gl_GETHRXTIME): Initialize LIB_GETHRXTIME here...
(gl_PREREQ_GETHRXTIME): ... not here.
2009-10-18 Bruno Haible
Avoid symlink attack in localcharset module.
* lib/localcharset.c: Include , .
(O_NOFOLLOW): Define fallback.
(get_charset_aliases): Don't open the file if it is a symbolic link.
* m4/fcntl_h.m4 (gl_FCNTL_O_FLAGS): New macro, extracted from
gl_FCNTL_H.
(gl_FCNTL_H): Require it.
* m4/localcharset.m4 (gl_LOCALCHARSET): Likewise.
* modules/localcharset (Files): Add m4/fcntl_h.m4.
Reported by Fergal Glynn .
2009-10-18 Bruno Haible
Implement nproc for mingw.
* lib/nproc.c: Include
(num_processors): On native Windows platforms, try GetSystemInfo.
2009-10-18 Bruno Haible
Implement nproc for IRIX.
* lib/nproc.c: Include .
(num_processors): On IRIX systems, try sysmp.
* m4/nproc.m4 (gl_PREREQ_NPROC): Check for sys/sysmp.h and sysmp.
2009-10-18 Bruno Haible
Implement nproc for HP-UX.
* lib/nproc.c: Include
(num_processors): On HP-UX systems, try pstat_getdynamic.
* m4/nproc.m4 (gl_PREREQ_NPROC): Check for sys/pstat.h and
pstat_getdynamic.
2009-10-18 Giuseppe Scrivano
Bruno Haible
Implement nproc for NetBSD, OpenBSD.
* lib/nproc.c: Include , , .
(ARRAY_SIZE): New macro.
(num_processors): On BSD systems, try sysctl of HW_NCPU.
* m4/nproc.m4: New file.
* modules/nproc (Files): Add m4/nproc.m4.
(configure.ac): Invoke gl_NPROC. Remove AC_LIBOBJ invocation.
(Makefile.am): Instead, augment lib_SOURCES.
2009-10-18 Bruno Haible
Fix recognition of sys/sysctl.h on OpenBSD 4.0.
* m4/physmem.m4 (gl_PHYSMEM): Before including sys/sysctl.h, include
sys/param.h.
2009-10-16 Eric Blake
utimensat: new module
* modules/utimensat: New file.
* lib/utimensat.c (utimensat): Likewise.
* m4/utimensat.m4 (gl_FUNC_UTIMENSAT): Likewise.
* lib/utimens.c (utimensat): Avoid recursion into rpl_utimensat,
so we can work around Linux bugs.
* m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Add witnesses.
* modules/sys_stat (Makefile.am): Substitute them.
* lib/sys_stat.in.h (utimensat): Declare it.
* MODULES.html.sh (systems lacking POSIX:2008): Mention module.
* doc/posix-functions/utimensat.texi (utimensat): Likewise.
* modules/utimensat-tests: New test.
* tests/test-utimensat.c: Likewise.
utimens: let lutimens work on non-symlinks
* lib/utimens.c (lutimens): Fall back to utimens rather than
failing with ENOSYS, when file is not a symlink.
(utimens): Reduce redirection.
* tests/test-lutimens.h (test_lutimens): Update test to cover
non-symlinks.
* tests/test-utimens.h (test_utimens): Update test to cover
symlinks.
* tests/test-utimens.c (main): Update caller.
utimens: cache whether utimensat syscall works
* lib/utimens.c (utimensat_works_really): New cache variable.
(fdutimens, lutimens): Use it to avoid failing syscall.
test-stat-time, test-utimens: improve portability
* tests/test-stat-time.c (nap): Lengthen delay to 20ms, for
ext4 on alpha, and for cygwin.
* tests/test-utimens-common.h: New file.
(nap): Factor delays into single function.
* tests/test-lutimens.h (test_lutimens): Use new header.
* tests/test-futimens.h (test_futimens): Likewise.
* tests/test-utimens.h (test_utimens): Likewise. Also, force NFS
timestamps to occur from same machine, as was done previously for
test_utimens.
* modules/utimens-tests (Files): Ship new file.
* modules/futimens-tests (Files): Likewise.
Reported in part by Jim Meyering.
sys_stat: sort replacement declarations
* lib/sys_stat.in.h: Sort declarations.
* lib/futimens.c (futimens): Fix typo.
2009-10-15 Jim Meyering
don't let environment settings perturb build
Setting the envvars, LIB_CLOCK_GETTIME, LIB_EACCESS or LIB_NANOSLEEP
could cause a configure-time and/or build-time malfunction.
Typically, a configure-time function-in-library test is performed
via code like this:
LIB_VAR=
AC_SUBST([LIB_VAR])
prefix_saved_LIBS=$LIBS
AC_SEARCH_LIBS([FUNC], [LIB_NAME],
[test "$ac_cv_search_FUNC" = "none required" ||
LIB_VAR=$ac_cv_search_FUNC])
LIBS=$prefix_saved_LIBS
However, in each of the files affected by this change, the LIB_VAR=
initialization was omitted. Thus, when set in the environment, its
value would propagate into generated Makefiles when FUNC is not found
in LIB_NAME.
* m4/clock_time.m4 (gl_CLOCK_TIME): Initialize AC_SUBST'd var.
* m4/euidaccess.m4 (gl_PREREQ_EUIDACCESS): Likewise.
* m4/nanosleep.m4 (gl_FUNC_NANOSLEEP): Likewise.
2009-10-14 Eric Blake
fchdir: avoid infinite recursion in mingw
* lib/fchdir.c (rpl_fstat): Call system fstat, rather than
recursing.
test-stat-time: port to mingw
* tests/test-stat-time.c (force_unlink): Return a value.
(test_ctime) [W32]: Fix compilation error.
(nap): Don't call usleep with too large an argument. Use
force_unlink.
* doc/pastposix-functions/usleep.texi (usleep): Document the
portability issue.
2009-10-13 Jim Meyering
use AC_CHECK_FUNCS_ONCE, not AC_CHECK_FUNCS in modules/*
* modules/pipe-filter-gi: Use AC_CHECK_FUNCS_ONCE, not AC_CHECK_FUNCS.
* modules/pipe-filter-ii: Likewise.
* modules/sys_socket-tests: Likewise.
* modules/tsearch-tests: Likewise.
* Makefile (sc_prefer_ac_check_funcs_once): New rule.
(check): Depend on it.
2009-10-12 Eric Blake
utimens-tests: port to NFS file systems
* tests/test-utimens.h (test_utimens): Refactor utimecmp
comparisons to avoid spurious failures from timestamp drift
between NFS machines.
2009-10-12 Eric Blake
stat-time-tests: minor cleanups
* modules/stat-time-tests (configure.ac): Use AC_CHECK_FUNCS_ONCE.
* tests/test-stat-time.c (nap): Separate assignment from call.
Suggested by Paolo Bonzini and Bruno Haible.
sys_stat: guarantee struct timespec
* lib/sys_stat.in.h (includes): Always include
* modules/sys_stat (Depends-on): Add time.
* tests/test-sys_stat.c: Guarantee struct timespec, as well as
mode_t permission values.
* doc/posix-headers/sys_stat.texi (sys/stat.h): Document how to
get at subsecond timestamps.
2009-10-10 Eric Blake
futimens: new module
* modules/futimens: New file.
* lib/futimens.c (futimens): Likewise.
* m4/futimens.m4 (gl_FUNC_FUTIMENS): Likewise.
* lib/utimens.c (futimens): Avoid recursion into rpl_futimens, so
we can work around Linux bugs.
* m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Add witnesses.
* modules/sys_stat (Makefile.am): Substitute them.
* lib/sys_stat.in.h (futimens): Declare it.
* MODULES.html.sh (systems lacking POSIX:2008): Mention module.
* doc/posix-functions/futimens.texi (futimens): Likewise.
* modules/futimens-tests: New test.
* tests/test-futimens.c: Likewise.
utimens: introduce fdutimens
* lib/utimens.h (fdutimens): New prototype.
* lib/utimens.c (gl_futimens): Move guts...
(fdutimens): ...to new interface.
* tests/test-utimens.c (do_fdutimens): Use it.
utimens: add UTIME_NOW and UTIME_OMIT support
* lib/utimens.c (validate_timespec, update_timespec): New helper
functions.
(gl_futimens, lutimens): Use them.
* modules/utimens (Depends-on): Add gettime, lstat, stat-time,
stdbool, sys_stat.
(Link): Mention resulting library dependency.
* modules/utimecmp (Link): Likewise.
* modules/utimens-tests (Depends-on): Drop stat-time, stdbool.
(Makefile.am): Pick up library dependency.
* lib/sys_stat.in.h (UTIME_NOW, UTIME_OMIT): Guarantee a
definition.
* tests/test-sys_stat.c: Test the definitions.
* doc/posix-headers/sys_stat.texi (sys/stat.h): Document this.
* NEWS: Document library dependency.
utimecmp: support symlink timestamps
* lib/utimecmp.c (utimecmp): Use new interface. Skip effort of
hashing when possible. Use pathconf when available.
(SYSCALL_RESOLUTION): Recognize tighter resolution.
* modules/utimecmp (Depends-on): Add lstat.
utimens: add lutimens interface
* lib/utimens.c (lutimens): New function.
* m4/utimens.m4 (gl_UTIMENS): Check for lutimes.
* lib/utimens.h (lutimens): Declare new interface.
* tests/test-utimens.c (main): Enhance test.
* tests/test-lutimens.h (test_lutimens): New file.
* modules/utimens-tests (Files): Distribute it.
(Depends-on): Add symlink.
(configure.ac): Check for usleep.
utimens: validate futimens usage
* lib/utimens.c (gl_futimens): Require valid fd up front, using
fewer syscalls on failure later on. Avoid compiler warning on
mingw.
* modules/utimens (Depends-on): Add dup2.
utimens: add test
* modules/utimens-tests: New test.
* tests/test-utimens.h: New file.
* tests/test-futimens.h: Likewise.
* tests/test-utimens.c: Likewise.
doc: mention timestamp portability issues
* doc/glibc-functions/lutimes.texi (lutimes): Refer to utimensat
instead.
* doc/posix-functions/utime.texi (utime): Likewise.
* doc/posix-functions/utimes.texi (utimes): Likewise.
* doc/glibc-functions/futimes.texi (futimes): Refer to futimens
instead.
* doc/posix-functions/futimens.texi (futimens): Mention utimens
module.
* doc/posix-functions/utimensat.texi (utimensat): Likewise.
Mention weakness with symlink timestamps.
* doc/glibc-functions/futimesat.texi (futimesat): New file; refer
to utimensat/futimens instead.
* doc/gnulib.texi (Glibc sys/time.h): Include new file.
test-dup2: enhance test
* tests/test-dup2.c (main): Also check AT_FDCWD.
test-stat-time: avoid more spurious failures
* tests/test-stat-time.c (nap): Wait for 15ms rather than 2ms, for
xfs; and avoid race if the two timestamps cross quantization edge.
relocatable: prefer 'file system' over 'filesystem'
* m4/relocatable-lib.m4 (gl_RELOCATABLE_NOP): Use AS_HELP_STRING.
(gl_RELOCATABLE_LIBRARY_BODY): Fix spelling.
* doc/relocatable-maint.texi (Supporting Relocation): Likewise.
* doc/relocatable.texi (Enabling Relocatability): Likewise.
* lib/relocatable.c (compute_curr_prefix): Likewise.
2009-10-10 Jim Meyering
stat-time-tests: check for the usleep function
* modules/stat-time-tests (configure.ac): Now that we test HAVE_USLEEP.
2009-10-10 Bruno Haible
* modules/xnanosleep: Put the Link section after the Include section.
2009-10-09 Eric Blake
dup2: work around FreeBSD 6.1 bug
* m4/dup2.m4 (gl_FUNC_DUP2): Detect bug.
* doc/posix-functions/dup2.texi (dup2): Document it.
Reported by Nelson H. F. Beebe and Jim Meyering.
test-stat-time: port to buggy NFS clients
* tests/test-stat-time.c (main) [W32]: Reduce ifdefs.
(test_ctime): Also skip test if mtime and ctime are skewed.
maint: prefer 'file system' over 'filesystem'
* doc/posix-functions/fstatat.texi (fstatat): Likewise.
* doc/posix-functions/lstat.texi (lstat): Likewise.
* lib/file-has-acl.c (file_has_acl): Likewise.
* lib/fwriteerror.c [TEST]: Likewise.
* tests/test-areadlink.h (test_areadlink): 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-fstatat.c (main): Likewise.
* tests/test-linkat.c (main): Likewise.
* tests/test-lstat.h (test_lstat_func): Likewise.
* tests/test-mkdir.h (test_mkdir): Likewise.
* tests/test-readlink.h (test_readlink): Likewise.
* tests/test-remove.c (main): Likewise.
* tests/test-rename.h (test_rename): Likewise.
* tests/test-renameat.c (main): Likewise.
* tests/test-rmdir.h (test_rmdir_func): Likewise.
* tests/test-symlink.h (test_symlink): Likewise.
* tests/test-symlinkat.c (main): Likewise.
* tests/test-unlink.h (test_unlink_func): Likewise.
* tests/test-unlinkat.c (main): Likewise.
maint: make realtime library usage explicit
* modules/gethrxtime (Link): Mention LIB_GETHRXTIME.
* modules/gettime (Link): Mention LIB_CLOCK_GETTIME.
* modules/settime (Link): Likewise.
* modules/xnanosleep (Link): Mention LIB_NANOSLEEP.
test-stat-time: speed up execution
* tests/test-stat-time.c (test_ctime) [!W32]: Avoid compiler
warning on mingw.
(nap): New helper function.
(prepare_test): Use it to reduce sleep time.
(test_mtime, test_ctime, test_birthtime): Allow for subsecond
execution.
* modules/stat-time-tests (configure.ac): Check for usleep.
2009-10-09 Jim Meyering
selinux-h: always use getfilecon wrappers
* lib/getfilecon.c: New file.
* lib/se-selinux.in.h: Use a better inclusion guard symbol name.
[HAVE_SELINUX_SELINUX_H]: Include-next .
[!HAVE_SELINUX_SELINUX_H]: Use better parameter names.
(fgetfilecon): Provide a stub.
* m4/selinux-selinux-h.m4 (gl_HEADERS_SELINUX_SELINUX_H): Don't
AC_SUBST SELINUX_SELINUX_H, since now we're generating that
file unconditionally.
When is found, arrange to use wrappers.
* modules/selinux-h (Files): Add getfilecon.c.
(Makefile.am): Substitute include-next-related bits
into the now-always-generated selinux/selinux.h file.
* doc/glibc-functions/lgetfilecon.texi: New file.
* doc/glibc-functions/fgetfilecon.texi: New file.
* doc/glibc-functions/getfilecon.texi: New file.
* doc/glibc-functions/getfilecon-desc.texi: New file.
* doc/gnulib.texi (Glibc selinux/selinux.h): New section, by
which to pull in the new files.
* MODULES.html.sh (Misc): Add selinux-h.
2009-10-08 Jim Meyering
unistd: fix comment typo
* lib/unistd.in.h (euidaccess): Fix a comment typo.
2009-10-08 Eric Blake
areadlink: use SIZE_MAX consistently
* modules/areadlink (Depends-on): Add stdint.
* modules/areadlink-with-size (Depends-on): Likewise.
* lib/areadlink-with-size.c (includes): Drop stdio, since stdlib
gives NULL; drop sys/types, since unistd gives size_t; and add
stdint for SIZE_MAX.
(SIZE_MAX): Rely on headers.
* lib/areadlinkat-with-size.c (includes): Drop stdio, sys/types,
and add stdint.
* lib/areadlink.c (includes): Drop sys/types, and add stdint.
(SIZE_MAX): Likewise.
(INITIAL_BUF_SIZE): Turn into enum.
* lib/areadlinkat.c (INITIAL_BUF_SIZE): Likewise.
2009-10-08 Jim Meyering
areadlinkat: avoid compilation failure
* lib/areadlinkat.c: Include for use of SIZE_MAX.
Fix typo in comment.
2009-10-07 Eric Blake
areadlinkat-with-size: new module
* modules/areadlinkat-with-size: New module.
* lib/areadlinkat-with-size.c (areadlinkat_with_size): New file.
* lib/areadlink.h (areadlinkat): Declare it.
* MODULES.html.sh (File system functions): Mention it.
* modules/areadlinkat-with-size-tests: New test.
* tests/test-areadlinkat-with-size.c: New file.
xreadlinkat: new module
* modules/xreadlinkat: New module.
* lib/xreadlinkat.c (xreadlinkat): New file.
* lib/xreadlink.h (xreadlinkat): Declare it.
* MODULES.html.sh (File system functions): Mention it.
areadlinkat: new module
* lib/at-func.c (FUNC_FAIL): New define.
(AT_FUNC_NAME, VALIDATE_FLAG): Use it rather than raw -1.
* modules/areadlinkat: New module.
* lib/linkat.c (areadlinkat): Move...
* lib/areadlinkat.c (areadlinkat): ...to new file.
* lib/areadlink.h (areadlinkat): Declare it.
* modules/linkat (Depends-on): Add areadlinkat.
* MODULES.html.sh (File system functions): Mention it.
* modules/areadlinkat-tests: New test.
* tests/test-areadlinkat.c: New file.
areadlink, areadlink-with-size: add tests
* modules/areadlink-tests: New test.
* modules/areadlink-with-size-tests: Likewise.
* tests/test-areadlink.h: New file.
* tests/test-areadlink.c: Likewise.
* tests/test-areadlink-with-size.c: Likewise.
maint: minor cleanups
* lib/fts.c (ATTRIBUTE_UNUSED): Delete; use gnulib-guaranteed
_UNUSED_PARAMETER_ instead.
* lib/getdate.y (ATTRIBUTE_UNUSED): Likewise.
* lib/utimens.c (ATTRIBUTE_UNUSED): Likewise.
* modules/linkat-tests (Files): Distribute test-link.h.
openat, utimens: whitespace cleanup
* lib/openat.c: Prefer space throughout, rather than mix of 8
spaces vs. tabs.
* lib/at-func.c: Likewise.
* lib/utimens.c: Likewise.
openat: avoid using wrong fd
* lib/openat.c (openat_permissive): Reject user's fd if saving the
working directory chooses same fd.
* lib/at-func.c (AT_FUNC_NAME): Likewise.
mkdir, mkdirat: fix cygwin 1.5.x bug
* lib/mkdir.c (rpl_mkdir) [FUNC_MKDIR_DOT_BUG]: Work around bug.
* m4/mkdir-slash.m4 (gl_FUNC_MKDIR_TRAILING_SLASH): Move...
* m4/mkdir.m4 (gl_FUNC_MKDIR): ...here, and add check for cygwin
bug.
(gl_PREREQ_MKDIR): Delete unused macro.
* modules/mkdir (Files): Track file rename.
(configure.ac): Update macro name.
* modules/openat (Depends-on): Add mkdir.
* doc/posix-functions/mkdir.texi (mkdir): Document the bug.
mkdir, mkdirat: add tests
* modules/mkdir-tests: New test.
* tests/test-mkdir.h: New file.
* tests/test-mkdir.c: Likewise.
* tests/test-mkdirat.c: Likewise.
* modules/openat-tests (Files): Add new files.
(Makefile.am): Run new test.
2009-10-06 Eric Blake
doc: tweak *at function documentation
* doc/posix-functions/faccessat.texi (faccessat): Mention
known issue with replacement.
* doc/posix-functions/fchdir.texi (fchdir): Likewise.
* doc/posix-functions/linkat.texi (linkat): Likewise.
* doc/posix-functions/mkfifoat.texi (mkfifoat): Likewise.
* doc/posix-functions/mknodat.texi (mknodat): Likewise.
* doc/posix-functions/readlinkat.texi (readlinkat): Likewise.
* doc/posix-functions/renameat.texi (renameat): Likewise.
* doc/posix-functions/symlinkat.texi (symlinkat): Likewise.
openat: fix GNU/Hurd bug in unlinkat
* m4/openat.m4 (gl_FUNC_OPENAT): Replace unlinkat if unlink is
broken.
* doc/posix-functions/unlink.texi (unlink): Document this.
* doc/posix-functions/unlinkat.texi (unlinkat): Likewise.
fdopendir: fix GNU/Hurd bug
* m4/fdopendir.m4 (gl_FUNC_FDOPENDIR): Check for Hurd bug in
allowing non-directory fds.
* lib/fdopendir.c (rpl_fdopendir): Work around it.
* m4/dirent_h.m4 (gl_DIRENT_H_DEFAULTS): New witness.
* modules/dirent (Makefile.am): Substitute it.
* lib/dirent.in.h (fdopendir): Declare replacement.
* doc/posix-functions/fdopendir.texi (fdopendir): Document this.
* tests/test-fdopendir.c (main): Test something other than
/dev/null, since on Hurd that behaves like a directory.
test-symlink: port to GNU/Hurd
* tests/test-symlink.h (test_symlink): Relax expected errno.
doc: tweak more cygwin information
* doc/glibc-headers/getopt.texi (getopt.h): Cygwin 1.7 getopt is
now compatible with glibc.
* doc/posix-functions/getopt.texi (getopt): Likewise.
getopt-gnu: add another test
* tests/test-getopt_long.h (test_getopt_long_posix): New test, to
guarantee behavior relied on by m4.
* tests/test-getopt.c (main): Use it.
* modules/getopt-posix-tests (Depends-on): Add setenv.
See http://lists.gnu.org/archive/html/bug-m4/2006-09/msg00028.html.
getopt: fix compilation on darwin
* lib/getopt.in.h (includes): Leave breadcrumbs during system
include.
* lib/unistd.in.h (getopt): Use them to avoid recursive include.
Reported by Ludovic Courtès.
2009-10-06 Bruno Haible
* modules/size_max (Description): Discourage its use.
Reported by Simon Josefsson.
2009-10-06 Jim Meyering
linkat: avoid compilation failure
* lib/linkat.c: Include for use of SIZE_MAX.
2009-10-05 Eric Blake
linkat: support Linux 2.6.17
* m4/linkat.m4 (gl_FUNC_LINKAT): Default to always replacing
linkat on Linux, but allow cache variable override.
* lib/linkat.c (rpl_linkat): Define override.
* modules/linkat (Depends-on): Add symlinkat.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Add new default.
* modules/unistd (Makefile.am): Substitute it.
* lib/unistd.in.h (linkat): Declare replacement.
Reported by Pádraig Brady.
quotearg: port test to systems with C.UTF-8 locale
* tests/test-quotearg.c (struct result_strings): Add another
member, differentiating between C.ASCII and C.UTF-8 handling.
(compare_strings): Add parameter.
(main): Adjust all callers.
getopt: avoid clash with FreeBSD _getopt_internal
* lib/getopt.in.h (_getopt_internal): Override the name.
* lib/getopt_int.h (includes): Pick up any overrides.
Reported by Reuben Thomas.
hash: allow C89 compilation
* lib/hash.c (check_tuning): Move declaration before statement.
Reported by Reuben Thomas.
2009-10-05 Karl Berry
* doc/gnulib.texi: @include execvpe.texi, missing for several days.
2009-10-04 Paolo Bonzini
Bruno Haible
* lib/uname.c (uname): Use a table-driven algorithm to compute
Windows NT versions.
2009-10-04 Bruno Haible
* lib/progname.c (set_program_name): Also remove the "lt-" prefix from
program_invocation_short_name.
* modules/progname (configure.ac): Test for presence of
program_invocation_short_name.
Reported by Sergey Poznyakoff .
2009-10-04 Bruno Haible
* lib/progname.c (set_program_name): Fix comment.
Reported by Jim Meyering.
2009-10-03 Paolo Bonzini
Bruno Haible
* lib/uname.c: Include .
(uname): Do only one call to GetVersionEx in the common case.
2009-10-03 Paolo Bonzini
Bruno Haible
* lib/uname.c (VER_PLATFORM_WIN32_CE, PROCESSOR_ARCHITECTURE_AMD64,
PROCESSOR_ARCHITECTURE_IA32_ON_WIN64): Define fallbacks.
(uname): Add support for Windows CE and various non-x86 CPU types.
2009-10-03 Bruno Haible
* gnulib-tool (func_create_testdir): Conditionally emit AM_PROG_CC_C_O
invocation to tests/configure.ac.
Reported by Ian Beckwith .
2009-10-02 Eric Blake
fchdir: avoid compiler warning
* lib/fchdir.c (canonicalize_file_name)
[!HAVE_CANONICALIZE_FILE_NAME]: Avoid compiler warning on mingw.
test-open: support mingw errno values
* tests/test-open.h (test_open): Relax test.
* tests/test-fopen.h (test_fopen): Likewise.
* tests/test-openat-safer.c (main): Likewise.
open: fix opening directory on mingw
* lib/open.c (open) [REPLACE_OPEN_DIRECTORY]: Correct typo.
test-open: on GNU/Hurd, /dev/null is a directory
* tests/test-fopen.h (main): Rename...
(test_fopen): ...to this. Use a guaranteed non-directory when
confirming open behavior on trailing slash.
* tests/test-openat-safer.c (main): Likewise.
* tests/test-open.h (main): Likewise....
(test_open): ...to this.
* tests/test-fopen.c (main): Adjust caller.
* tests/test-fopen-safer.c (main): Likewise.
* tests/test-open.c (main): Likewise.
* tests/test-fcntl-safer.c (main): Likewise.
Reported by Samuel Thibault.
rename, fchdir: don't ignore chdir failure
* lib/fchdir.c (get_name): Abort on unexpected chdir failure.
* lib/rename.c (rpl_rename) [W32]: Likewise.
(rpl_rename) [RENAME_DEST_EXISTS_BUG]: Avoid one case of losing
an empty destination directory if source cannot be renamed,
although there is still possibility for failure.
* doc/posix-functions/rename.texi (rename): Document the race.
Reported by Jim Meyering.
maint: cleanup whitespace in recent commits
* lib/rename.c (rpl_rename): Remove tabs.
* tests/test-link.h (test_link): Likewise.
* lib/fchdir.c (get_name): Likewise.
Reported by Jim Meyering.
2009-10-02 Ben Pfaff
relocatable-prog-wrapper: Add missing dependency on
double-slash-root.
* modules/relocatable-prog-wrapper: Add dependency.
Reported by Ian Beckwith .
2009-10-02 Eric Blake
renameat: fix Solaris bugs
* m4/renameat.m4 (gl_FUNC_RENAMEAT): Replace renameat if rename
needed fixing.
* m4/stdio_h.m4 (gl_STDIO_H_DEFAULTS): New witness.
* modules/stdio (Makefile.am): Substitute it.
* lib/stdio.in.h (renameat): Declare replacement.
* lib/renameat.c (rpl_renameat): Implement fix.
renameat: new module
* modules/renameat: New file.
* lib/renameat.c (renameat): Likewise.
* m4/renameat.m4 (gl_FUNC_RENAMEAT): Likewise.
* m4/stdio_h.m4 (gl_STDIO_H_DEFAULTS): Add witnesses.
* modules/stdio (Makefile.am): Substitute them.
* lib/stdio.in.h (renameat): Declare it.
* MODULES.html.sh (systems lacking POSIX:2008): Mention module.
* doc/posix-functions/renameat.texi (renameat): Likewise.
* modules/renameat-tests: New test.
* tests/test-renameat.c: Likewise.
rename: fix mingw bugs
* lib/rename.c (rpl_rename) [W32]: Fix trailing slash and
directory overwrite bugs.
rename: fix another cygwin 1.5 bug
* m4/rename.m4 (gl_FUNC_RENAME): Split cygwin bugs into two
checks.
* lib/rename.c (rpl_rename): Don't penalize NetBSD with
unnecessary cygwin workarounds. Also work around bug with moving
full directory onto an empty one.
* modules/rename (Depends-on): Add canonicalize-lgpl, rmdir.
rename-dest-slash: merge into rename module
* modules/rename-dest-slash (Status): Mark obsolete.
(Depends-on): Add rename.
(Files): Let rename do it all.
* m4/rename.m4 (gl_FUNC_RENAME): Also test for NetBSD bugs,
subsuming the test from gl_FUNC_RENAME_TRAILING_DEST_SLASH...
* m4/rename-dest-slash.m4: ...so this file can be deleted.
* lib/rename-dest-slash.c (rpl_rename_dest_slash): Delete.
* lib/rename.c (rpl_rename): Update comments.
rename: fix cygwin 1.5.x bugs
* m4/rename.m4 (gl_FUNC_RENAME): Detect cygwin bugs.
* lib/rename.c (rpl_rename): Work around them.
* modules/rename (Depends-on): Add same-inode.
rename: fix Solaris 10 bug
* m4/rename.m4 (gl_FUNC_RENAME): Detect Solaris bug.
* lib/rename.c (rpl_rename): Don't cripple POSIX behavior if this
was the only bug.
rename: fix Solaris 9 bug
* lib/rename.c (rpl_rename): Rewrite to recognize trailing slash
on non-directory. Avoid calling exit.
* modules/rename (Depends-on): Drop xalloc; add lstat, stdbool,
strdup.
* modules/rename-tests (Depends-on): Drop lstat.
* m4/rename.m4 (gl_FUNC_RENAME): Detect Solaris bug.
(gl_PREREQ_RENAME): Delete unused macro.
rename-dest-slash: fix NetBSD bug
* lib/rename-dest-slash.c (rpl_rename_dest_slash): Detect hard
links.
* modules/rename-dest-slash (Depends-on): Add same-inode.
rename-tests: new test, exposes several platform bugs
* modules/rename-tests: New file.
* tests/test-rename.h: Likewise.
* tests/test-rename.c: Likewise.
* doc/posix-functions/rename.texi (rename): Improve documentation,
including bugs that will eventually be fixed in gnulib.
2009-10-02 Paolo Bonzini
* lib/uname.c: Include
(uname): Assume version info is available.
2009-10-02 Jim Meyering
gnu-web-doc-update: correct --help output
* build-aux/gnu-web-doc-update: Make --help output relevant.
gnu-web-doc-update: add standard options
* build-aux/gnu-web-doc-update: Add --help, --version, etc.
gnu-web-doc-update: New module.
Use this script to automatically update the on-line web documentation
for your GNU project at http://www.gnu.org/software/$pkg/manual/
* modules/gnu-web-doc-update: New file, from coreutils.
* build-aux/gnu-web-doc-update: New script.
2009-10-01 Paolo Bonzini
link: LoadLibrary is not needed.
* lib/link.c: Use GetModuleHandle.
2009-10-01 Eric Blake
getopt: bump serial number
* m4/getopt.m4: Increment serial number, to account for 2009-09-24
change.
tests: tighten link, rmdir, and remove tests
* tests/test-link.h (includes): No need to use here.
Clean up if directory hard link was created, otherwise test for
trailing '.'.
* tests/test-linkat.c (main): Simplify.
* tests/test-remove.c (main): Enhance test for trailing '.'.
* tests/test-rmdir.h (test_rmdir_func): Likewise.
2009-10-01 Jim Meyering
maint.mk: requiring "make major" was annoying, for a "minor" release.
What is intended is "stable", to contrast with alpha and beta,
so require "make stable", not "make major".
* build-aux/announce-gen (%valid_release_types): s/major/stable/.
(get_tool_versions): Likewise.
* top/maint.mk (ALL_RECURSIVE_TARGETS): s/major/stable/
2009-09-30 Ben Pfaff
Fix broken build of replacement for Windows tmpfile().
* lib/tmpfile.c (tmpfile): Fix call to gen_tempname() to provide
flags argument added along with the 'mkostemp' module.
2009-09-28 Bruno Haible
Avoid identifier clash with POSIX function 'remove' defined as a macro.
* lib/gl_list.h (struct gl_list_implementation): Rename field 'remove'
to 'remove_elt'.
(gl_list_remove): Update.
* lib/gl_list.c (gl_list_remove): Update.
* lib/gl_oset.h (struct gl_oset_implementation): Rename field 'remove'
to 'remove_elt'.
(gl_oset_remove): Update.
* lib/gl_list.c (gl_oset_remove): Update.
Reported by Eric Blake.
2009-09-28 Eric Blake
doc: mention yet more cygwin 1.7 status
* doc/posix-functions/fexecve.texi (fexecve): Now implemented in
cygwin.
* doc/glibc-functions/execvpe.texi (execvpe): New file.
* doc/gnulib.texi (Glibc unistd.h): Mention it.
argp: fix test failure
* lib/argp-help.c (hol_entry_cmp): Don't use _tolower on values
that are not upper-case. Pass correct range to tolower.
2009-09-27 Jim Meyering
test-yesno: work around sparc-dash here-document infelicity
Without this change, the literal \177 byte in a here document
would make dash 0.5.5.1-3 access uninitialized memory.
* tests/test-yesno.sh: Don't put the \177 byte in the here document.
Instead, use a marker, "@", and filter through tr to create the desired
contents. Reported as by Kurt Roeckx.
2009-09-27 Bruno Haible
Disable untested support for new flavours of ACLs on AIX.
* lib/file-has-acl.c (file_has_acl): Mark newer AIX code as work in
progress.
* lib/set-mode-acl.c (qset_acl): Likewise.
2008-12-07 Bruno Haible
Add support for new flavours of ACLs on AIX. (Untested.)
* lib/file-has-acl.c [AIX] (acl_nfs4_nontrivial): New function.
(file_has_acl): Add support for newer AIX.
* lib/set-mode-acl.c (qset_acl): Likewise.
* tests/test-sameacls.c (main): Fix use of aclx_get function. Hint by
Rainer Tammer .
2009-09-26 Eric Blake
argp: fix compilation of getopt
* lib/getopt.in.h (includes): Use different guard than glibc.
Reported by Sergey Poznyakoff.
doc: mention more cygwin 1.7 status
* doc/posix-functions/access.texi (access): Mention cygwin 1.5
bug.
* doc/posix-functions/execl.texi (execl): Likewise.
* doc/posix-functions/execle.texi (execle): Likewise.
* doc/posix-functions/execlp.texi (execlp): Likewise.
* doc/posix-functions/execv.texi (execv): Likewise.
* doc/posix-functions/execve.texi (execve): Likewise.
* doc/posix-functions/execvp.texi (execvp): Likewise.
* doc/glibc-functions/canonicalize_file_name.texi
(canonicalize_file_name): Cygwin 1.7 now provides this.
* doc/glibc-functions/euidaccess.texi (euidaccess): Likewise.
* doc/posix-functions/fchmodat.texi (fchmodat): Mention limitation
on AT_SYMLINK_NOFOLLOW.
2009-09-24 Eric Blake
test-linkat: make test more robust
* tests/test-linkat.c (main): Avoid collision with EEXIST.
getopt: fix inclusion guards for cygwin
* modules/getopt-posix (Depends-on): Add include-next.
(Makefile.am): Substitute more items in replacement header.
* m4/getopt.m4 (gl_GETOPT_CHECK_HEADERS): Also check for native
.
* lib/getopt.in.h (includes): Use split inclusion guard, and
prefer over include when one is present.
(option): Also override name of 'struct option'.
same-inode: revert prior change; it is not yet ready
* NEWS: Undo mention of this change.
* lib/same-inode.h (same-inode.h): Undo tri-state change.
* lib/cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Update caller.
* lib/cycle-check.c (cycle_check): Likewise.
* lib/same.c (same_name): Likewise.
* lib/at-func2.c (at_func2): Likewise.
2009-09-23 Eric Blake
linkat: new module
* modules/linkat: New file.
* lib/at-func2.c (at_func2): Likewise.
* lib/linkat.c (linkat): Likewise.
* m4/linkat.m4 (gl_FUNC_LINKAT): Likewise.
* lib/openat-priv.h (at_func2): Add declaration.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Add witnesses.
* modules/unistd (Makefile.am): Substitute them.
* lib/unistd.in.h (linkat): Declare it.
* MODULES.html.sh (systems lacking POSIX:2008): Mention module.
* doc/posix-functions/linkat.texi (linkat): Likewise.
* doc/posix-functions/link.texi (link): Tweak wording.
* tests/test-link.c (main): Move guts...
* tests/test-link.h (test_link): ...into new file.
* modules/linkat-tests: New test.
* tests/test-linkat.c: Likewise.
* modules/link-tests (Files): Ship new file.
(Depends-on): Add stdbool.
dirname: add library-safe mdir_name
* lib/dirname.h (mdir_name): New prototype.
* lib/dirname.c (dir_name): Move guts...
(mdir_name): ...to new function that avoids xalloc_die.
fchdir: another mingw fix
* modules/fchdir (Depends-on): Drop canonicalize-lgpl.
* lib/fchdir.c (get_name): New helper method; skips canonicalize
on mingw (where it has not yet been ported), and make it optional
elsewhere.
(_gl_register_fd): Use it.
same-inode: make SAME_INODE tri-state, to port to mingw
* NEWS: Mention this change.
* lib/same-inode.h (same-inode.h): Recognize mingw limitation of
st_ino always being 0.
* lib/cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Update caller.
* lib/cycle-check.c (cycle_check): Likewise.
* lib/same.c (same_name): Likewise.
lstat: avoid mingw compilation error
* m4/lstat.m4 (gl_FUNC_LSTAT): Avoid duplicate calls to
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK, and deal with missing
lstat ourselves.
* lib/lstat.c [!HAVE_LSTAT]: Do nothing if override
was adequate.
* m4/sys_stat_h.m4 (gl_HEADER_SYS_STAT_H): Let lstat module handle
the checks for lstat.
(gl_SYS_STAT_H_DEFAULTS): Set default for HAVE_LSTAT.
link: fix test failure on Solaris 9
* lib/link.c (rpl_link): Don't assume link will catch bogus
trailing slash on source.
test-symlinkat: enhance test
* tests/test-readlink.c (main): Move guts...
* tests/test-readlink.h (test_readlink): ...into new file.
* tests/test-symlink.c (main): Move guts...
* tests/test-symlink.h (test_symlink): ...into new file.
* tests/test-symlinkat.c (main): Use new files for further
coverage.
(do_symlink, do_readlink): New helper functions.
* modules/symlink-tests (Files): Ship new file.
(Depends-on): Add stdbool.
* modules/readlink-tests (Files): Ship new file.
(Depends-on): Add stdbool.
* modules/symlinkat-tests (Files): Use new files.
2009-09-23 Eric Blake
readlink: document portability issue with symlink length
* doc/posix-functions/lstat.texi (lstat): Mention that some file
systems have bogus st_size on symlinks, and mention the
areadlink-with-size module.
* doc/posix-functions/fstatat.texi (fstatat): Likewise.
* doc/posix-functions/readlink.texi (readlink): Mention the
areadlink module, and ERANGE failure.
* doc/posix-functions/readlinkat.texi (readlinkat): Likewise.
* tests/test-readlink.c (main): Relax test for AIX, HP-UX.
readlink: fix Solaris 9 bug with trailing slash
* lib/readlink.c (rpl_readlink): Work around trailing slash bug.
* m4/readlink.m4 (gl_FUNC_READLINK): Detect the bug.
* doc/posix-functions/readlink.texi (readlink): Document this.
* modules/readlink-tests: New test.
* tests/test-readlink.c: Likewise.
readlink: fix cygwin 1.5.x bug with return type
* m4/readlink.m4 (gl_FUNC_READLINK): Require correct signature.
* lib/unistd.in.h (readlink): Use ssize_t.
* lib/readlink.c (readlink): Likewise.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Add witness.
* modules/unistd (Makefile.am): Substitute it.
* lib/unistd.in.h (readlink): Declare replacement.
* doc/posix-functions/readlink.texi (readlink): Document this.
symlink: use throughout gnulib
* m4/symlinkat.m4 (gl_FUNC_SYMLINKAT): Omit symlink check.
* lib/symlinkat.c (symlinkat) [!HAVE_SYMLINK]: Document why
symlink is not used.
* modules/symlinkat (Depends-on): Add symlink.
* modules/canonicalize-lgpl-tests (Depends-on): Likewise.
* modules/canonicalize-tests (Depends-on): Likewise.
* modules/lstat-tests (Depends-on): Likewise.
* modules/openat-tests (Depends-on): Likewise.
* modules/remove-tests (Depends-on): Likewise.
* modules/rmdir-tests (Depends-on): Likewise.
* modules/unlink-tests (Depends-on): Likewise.
* tests/test-canonicalize-lgpl.c (symlink): Delete stub.
* tests/test-canonicalize.c (symlink): Likewise.
* tests/test-fstatat.c (symlink): Likewise.
* tests/test-lstat.c (symlink): Likewise.
* tests/test-remove.c (symlink): Likewise.
* tests/test-rmdir.c (symlink): Likewise.
* tests/test-unlink.c (symlink): Likewise.
* tests/test-unlinkat.c (symlink): Likewise.
symlink: new module, for Solaris 9 bug
* modules/symlink: New file.
* m4/symlink.m4 (gl_FUNC_SYMLINK): Likewise.
* lib/symlink.c: Likewise.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Add defaults.
* modules/unistd (Makefile.am): Substitute them.
* lib/unistd.in.h (symlink): Declare replacement.
* MODULES.html.sh (File system functions): Mention it.
* doc/posix-functions/symlink.texi (symlink): Likewise.
* modules/symlink-tests: New test.
* tests/test-symlink.c: Likewise.
2009-09-23 Bruno Haible
* gnulib-tool (func_import): Add 'link-warning' to testsrelated_modules
when needed.
Test case: gnulib-tool --import --with-tests atexit inttypes.
Reported by Pauli Miettinen .
2009-09-23 Bruno Haible
* gnulib-tool (func_emit_tests_Makefile_am): Set uses_subdirs in a
subcommand, not in a subshell.
2009-09-22 Eric Blake
unistd: sort replacement declarations
* lib/unistd.in.h: Sort declarations.
open, openat: minor optimization
* lib/open.c (open): If open succeeded, len is non-zero.
* lib/openat.c (rpl_openat): Likewise.
link-follow: ensure correct result
* m4/fcntl_h.m4 (gl_FCNTL_H): Clean up temporary file.
* m4/link-follow.m4 (gl_FUNC_LINK_FOLLOWS_SYMLINK): Likewise, and
distinguish between possible failures.
2009-09-21 Eric Blake
fts: avoid compiler warning
* lib/fts.c (dirent_inode_sort_may_be_useful)
(leaf_optimization_applies) [!__linux__]: Mark unused parameters.
2009-09-19 Bruno Haible
* lib/progreloc.c (canonicalize_file_name): New declaration.
2009-09-19 Eric Blake
link: fix quoting
* m4/link.m4 (gl_FUNC_LINK): Fix shell quoting.
openat: fix openat bugs on Solaris 9
* lib/openat.c (rpl_openat): Work around Solaris 9 bug.
* m4/openat.m4 (gl_FUNC_OPENAT): Also replace openat on Solaris.
* modules/openat (Depends-on): Add open.
* m4/fcntl_h.m4 (gl_FCNTL_H_DEFAULTS): Provide new default.
* modules/fcntl-h (Makefile.am): Substitute it.
* lib/fcntl.in.h (openat): Declare replacement.
* doc/posix-functions/openat.texi (openat): Document this.
openat: move fstatat and unlinkat into correct files
* m4/openat.m4 (gl_FUNC_OPENAT): Adjust which files will be
compiled.
* lib/openat.c (fstatat, unlinkat): Move...
* lib/fstatat.c (fstatat): ...into correct files.
* lib/unlinkat.c (unlinkat): Likewise.
openat: fix unlinkat bugs on Solaris 9
* lib/unlinkat.c (unlinkat): New file.
* modules/openat (Depends-on): Add unlink.
(Files): Distribute it.
* m4/openat.m4 (gl_FUNC_OPENAT): Mark unlinkat for replacement if
trailing slash behavior is broken.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Add witness.
* modules/unistd (Makefile.am): Substitute it.
* lib/unistd.in.h (unlinkat): Declare replacement.
* doc/posix-functions/unlinkat.texi (unlinkat): Document this.
openat: fix fstatat bugs on Solaris 9
* lib/fstatat.c (rpl_fstatat): Copy recent fixes from lstat and
stat.
* doc/posix-functions/fstatat.texi (fstatat): Document this.
test-unlinkat: enhance test, to expose Solaris 9 bug
* tests/test-unlink.c (main): Factor guts...
* tests/test-unlink.h (test_rmdir_func): ...into new file.
* tests/test-rmdir.h (test_rmdir_func): Add parameter.
* tests/test-rmdir.c (main): Adjust caller.
* tests/test-unlinkat.c (main): Likewise. Add unlink tests.
(unlinker): New helper function.
(rmdirat): Enhance check.
* modules/rmdir-tests (Depends-on): Add stdbool.
* modules/unlink-tests (Depends-on): Likewise.
(Files): Add test-unlink.h.
* modules/openat-tests (Files): Likewise.
(Depends-on): Add unlinkdir.
test-fstatat: new test, to expose Solaris 9 bugs
* tests/test-stat.c (main): Factor guts...
* tests/test-stat.h (test_stat_func): ...into new file.
* tests/test-lstat.c (main): Factor guts...
* tests/test-lstat.h (test_lstat_func): ...into new file.
* tests/test-fstatat.c: New file.
* modules/stat-tests (Files): Add test-stat.h.
* modules/lstat-tests (Files): Add test-lstat.h.
(Depends-on): Add stdbool.
* modules/openat-tests (Depends-on): Add pathmax.
(Files): Add test-lstat.h, test-stat.h, test-fstatat.c.
(Makefile.am): Run new test.
remove: new module, for mingw and Solaris 9 bugs
* modules/remove: New file.
* lib/remove.c: Likewise.
* m4/remove.m4 (gl_FUNC_REMOVE): Likewise.
* m4/stdio_h.m4 (gl_STDIO_H_DEFAULTS): Add witnesses.
* modules/stdio (Makefile.am): Use them.
* lib/stdio.in.h (remove): Declare replacement.
* MODULES.html.sh (systems lacking POSIX:2008): Mention module.
* doc/posix-functions/remove.texi (remove): Likewise.
* modules/remove-tests: New test.
* tests/test-remove.c: Likewise.
unlink: new module, for Solaris 9 bug
* modules/unlink: New file.
* lib/unlink.c: Likewise.
* m4/unlink.m4 (gl_FUNC_UNLINK): Likewise.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Add witnesses.
* modules/unistd (Makefile.am): Use them.
* lib/unistd.in.h (stat): Declare replacement.
* MODULES.html.sh (systems lacking POSIX:2008): Mention module.
* doc/posix-functions/unlink.texi (unlink): Likewise.
* modules/unlink-tests: New test.
* tests/test-unlink.c: Likewise.
lstat: fix Solaris 9 bug
* lib/lstat.c (lstat): Also check for trailing slash on
non-symlink, non-directories. Use stat module to simplify logic.
* doc/posix-functions/lstat.texi (lstat): Document it.
* modules/lstat-tests (Depends-on): Add errno, same-inode.
(configure.ac): Check for symlink.
* tests/test-lstat.c (main): Add more tests.
stat: add as dependency to other modules
* modules/chown (Depends-on): Add stat.
* modules/euidaccess (Depends-on): Likewise.
* modules/fchdir (Depends-on): Likewise.
* modules/isdir (Depends-on): Likewise.
* modules/link (Depends-on): Likewise.
* modules/lstat (Depends-on): Likewise.
* modules/mkdir-p (Depends-on): Likewise.
* modules/modechange (Depends-on): Likewise.
* modules/open (Depends-on): Likewise.
* modules/readlink (Depends-on): Likewise.
* modules/same (Depends-on): Likewise.
stat: fix Solaris 9 bug
* m4/stat.m4 (gl_FUNC_STAT): Detect Solaris 9 bug with trailing
slash.
* lib/stat.c (rpl_stat): Work around it.
* doc/posix-functions/stat.texi (stat): Update documentation.
stat: new module, for mingw bug
* modules/stat: New file.
* lib/stat.c: Likewise.
* m4/stat.m4 (gl_FUNC_STAT): Likewise.
* m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Add witnesses.
* modules/sys_stat (Makefile.am): Use them.
* lib/sys_stat.in.h (stat): Declare replacement.
* lib/openat.c (fstatat): Deal with lstat and stat being function
macros.
* modules/openat (Depends-on): Add inline.
* MODULES.html.sh (systems lacking POSIX:2008): Mention module.
* doc/posix-functions/stat.texi (stat): Likewise.
* modules/stat-tests: New test.
* tests/test-stat.c: Likewise.
2009-09-19 Jim Meyering
syntax-check: detect unnecessary inclusion of canonicalize.h
* top/maint.mk (sc_prohibit_canonicalize_without_use): New rule.
2009-09-19 Eric Blake
canonicalize-lgpl: adjust clients to use correct header
* m4/canonicalize.m4 (gl_FUNC_CANONICALIZE_FILENAME_MODE)
(gl_CANONICALIZE_LGPL): Use correct shell quoting.
* modules/relocatable-prog-wrapper (Files): Drop canonicalize.h.
* lib/fchdir.c (includes): Use , not "canonicalize.h".
* lib/progreloc.c (includes): Likewise.
2009-09-19 Jim Meyering
test-posixtm.c: correct a comment
* tests/test-posixtm.c: Correct first-line comment.
Spotted by Eric Blake.
2009-09-16 Jim Meyering
posixtm-tests: make T const-correct; add a test case
* tests/test-posixtm.c (T): Declare const.
Add a test for -(2^31+1).
Remove useless can-succeed-only-in-2002 test.
posixtm-tests: adjust the sole failing test
* tests/test-posixtm.c: Correct 0000-01-01 00:00:00 test so that
expected output matches what mktime now produces. Cross-checked via
erlang's calendar:datetime_to_gregorian_seconds({{1970,1,1},{0,0,0}})
posixtm: move #ifdef'd tests into a new module
* lib/posixtm.c (posixtime): Remove #ifdef'd tests. Move to...
* tests/test-posixtm.c: ... this new file.
* modules/posixtm-tests: New module.
2009-09-19 Eric Blake
openat: simplify use of at-func.c
* lib/at-func.c (includes): Include prerequisites here, to
simplify requirements on client files.
* lib/openat-priv.h: Add double-inclusion guard.
* lib/faccessat.c (includes): Simplify.
* lib/fchmodat.c (includes): Likewise.
* lib/fchownat.c (includes): Likewise.
* lib/mkdirat.c (includes): Likewise.
* lib/mkfifoat.c (includes): Likewise.
* lib/symlinkat.c (includes): Likewise.
openat: allow return of fd 0
* modules/chdir-long (Depends-on): Relax openat-safer to openat.
* modules/save-cwd (Depends-on): Replace fcntl-safer with
unistd-safer.
* lib/chdir-long.c (includes): Replace "fcntl--.h" with
; this module does not leak fds.
* lib/openat.c (includes): Do not use "fcntl_safer"; plain openat
must be allowed to return 0, leaving openat_safer to add the
safety.
(openat_permissive): Avoid writing to just-opened fd 2 if
restoring the current directory fails.
* lib/openat-die.c (openat_restore_fail): Add comment.
* lib/save-cwd.c (includes): Make "fcntl--.h" conditional.
(save_cwd): Guarantee safe fd, but without use of open_safer.
* tests/test-openat.c: New test.
* modules/openat-tests (Files, Makefile.am): Distribute and build
new file.
relocatable-prog-wrapper: fix build
* modules/relocatable-prog-wrapper (Files): Update name of
canonicalize m4 file, broken on 2009-09-17.
Reported by emad hajjar .
2009-09-19 Bruno Haible
* lib/safe-alloc.h: Use the standard header with GPL copyright.
* lib/safe-alloc.c: Likewise.
Reported by Ian Beckwith .
2009-09-18 Bruno Haible
* gnulib-tool: Add advice to "cannot find configure.ac" error message.
Reported by .
2009-09-17 Eric Blake
canonicalize: in CAN_ALL_BUT_LAST, allow trailing slash
* lib/canonicalize.c (canonicalize_filename_mode): Skip trailing
slashes when checking if last component is missing.
* tests/test-canonicalize.c (main): Test this.
canonicalize, canonicalize-lgpl: honor // if distinct from /
* modules/canonicalize (Files): Add double-slash-root.m4.
* modules/canonicalize-lgpl (Files): Likewise.
* m4/canonicalize.m4 (gl_FUNC_CANONICALIZE_FILENAME_MODE)
(gl_CANONICALIZE_LGPL_SEPARATE): Add dependency.
* lib/canonicalize.c (DOUBLE_SLASH_IS_DISTINCT_ROOT): Provide
fallback definition.
(canonicalize_filename_mode): Use it to protect //.
* lib/canonicalize-lgpl.c (DOUBLE_SLASH_IS_DISTINCT_ROOT)
(__realpath): Likewise.
* tests/test-canonicalize.c (main): Test this.
* tests/test-canonicalize-lgpl.c (main): Likewise.
* modules/canonicalize-tests (Depends-on): Add same-inode.
* modules/canonicalize-lgpl-tests (Depends-on): Likewise.
canonicalize-lgpl: fix glibc bug with trailing slash
* m4/canonicalize-lgpl.m4: Move contents...
* m4/canonicalize.m4: ...here.
(gl_CANONICALIZE_LGPL): Factor realpath check...
(gl_FUNC_REALPATH_WORKS): ...into new macro. Enhance to catch
glibc 2.3.5 bug, fixed 2005-04-27.
(gl_FUNC_CANONICALIZE_FILENAME_MODE): Use it.
(gl_PREREQ_CANONICALIZE_LGPL): Inline...
(gl_CANONICALIZE_LGPL_SEPARATE): ...into this macro.
* modules/canonicalize-lgpl (Files): Manage file rename.
* m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Provide default.
* modules/stdlib (Makefile.am): Substitute witness.
* lib/stdlib.in.h (canonicalize_file_name): Declare if replacement
is needed.
* lib/canonicalize-lgpl.c: Also compile if canonicalize_file_name
replacement is required.
* lib/canonicalize.c (canonicalize_file_name): Likewise.
* doc/glibc-functions/canonicalize_file_name.texi
(canonicalize_file_name): Document this.
* doc/posix-functions/realpath.texi (realpath): Likewise.
canonicalize-lgpl: reject non-directory with trailing slash
* lib/canonicalize-lgpl.c (__realpath): Synchronize with glibc.
* tests/test-canonicalize-lgpl.c (main): Enhance test. This
catches failures in glibc 2.3.5.
* tests/test-canonicalize.c (main): Likewise.
canonicalize-lgpl: use native realpath if it works
* lib/canonicalize-lgpl.c (realpath): Guard with
FUNC_REALPATH_WORKS.
* lib/stdlib.in.h (realpath): Make declaration optional based on
HAVE_REALPATH.
* m4/canonicalize-lgpl.m4 (gl_CANONICALIZE_LGPL): Check whether
native realpath works.
* m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Provide default.
* modules/stdlib (Makefile.am): Substitute witness.
canonicalize, canonicalize-lgpl: use
* modules/canonicalize-lgpl (Files): Drop canonicalize.h.
(Include): Mention .
(configure.ac): Mention functions we provide.
* modules/canonicalize (configure.ac): Likewise.
* m4/canonicalize-lgpl.m4 (gl_CANONICALIZE_LGPL): Always replace
realpath if canonicalize_file_name is missing.
* m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Provide defaults.
* modules/stdlib (Makefile.am): Substitute witnesses.
* lib/stdlib.in.h (canonicalize_file_name, realpath): Declare.
* lib/canonicalize-lgpl.c (includes): Adjust accordingly.
* lib/canonicalize.h (canonicalize_file_name): Drop declaration.
* NEWS: Document this.
* doc/glibc-functions/canonicalize_file_name.texi
(canonicalize_file_name): Likewise.
* doc/posix-functions/realpath.texi (realpath): Likewise.
* tests/test-canonicalize-lgpl.c (includes): Use .
test-canonicalize: consolidate into single C program
* tests/test-canonicalize.sh: Delete; move setup into...
* tests/test-canonicalize.c (main): ...the program, making it
easier to run in debugger. Add some tests.
* modules/canonicalize-tests (Files): Remove unused file.
(Depends-on): Add progname.
(configure.ac, Makefile.am): Simplify.
test-canonicalize-lgpl: consolidate into single C program
* tests/test-canonicalize-lgpl.sh: Delete; move setup into...
* tests/test-canonicalize-lgpl.c (main): ...the program, making it
easier to run in debugger. Add some tests.
* modules/canonicalize-lgpl-tests (Files): Remove unused file.
(configure.ac, Makefile.am): Simplify.
canonicalize: avoid resolvepath
* m4/canonicalize.m4 (gl_FUNC_CANONICALIZE_FILENAME_MODE): Delete
unnecessary checks.
* lib/canonicalize.c (includes): Simplify.
(canonicalize_file_name): Drop resolvepath implementation.
* modules/canonicalize (Depends-on): Drop filenamecat.
canonicalize: don't lose errno
* lib/canonicalize.c (canonicalize_filename_mode): Protect errno
over calls to free.
canonicalize: simplify errno handling
* lib/canonicalize.c (__set_errno): Delete macro, and use direct
assignment.
canonicalize, canonicalize-lgpl: update module dependencies
* modules/canonicalize (Depends-on): Add extensions, lstat,
pathmax, stdlib.
(Files): Drop pathmax.h.
(configure.ac): Adjust macro name.
* modules/canonicalize-lgpl (Depends-on): Add errno, extensions,
lstat, stdlib, sys_stat.
* m4/canonicalize.m4 (AC_FUNC_CANONICALIZE_FILE_NAME): Rename...
(gl_FUNC_CANONICALIZE_FILENAME_MODE): ...to this, and require
extensions.
* m4/canonicalize-lgpl.m4 (gl_CANONICALIZE_LGPL)
(gl_CANONICALIZE_LGPL_SEPARATE): Require extensions.
(gl_PREREQ_CANONICALIZE_LGPL): Assume unistd.h.
* lib/canonicalize.h (canonicalize_file_name): Use
declaration, if available.
* lib/canonicalize-lgpl.c [HAVE_READLINK]: Delete this condition;
we can rely on the readlink module.
(MAXSYMLINKS): Also consult SYMLOOP_MAX.
(includes): Use unconditionally.
2009-09-17 Eric Blake
maint: make Include sections of modules consistent
* modules/alloca: Use only header name; no need to list #include.
* modules/alloca-opt: Likewise.
* modules/arpa_inet: Likewise.
* modules/canon-host: Likewise.
* modules/configmake: Likewise.
* modules/dirent: Likewise.
* modules/eealloc: Likewise.
* modules/environ: Likewise.
* modules/fchdir: Likewise.
* modules/fcntl: Likewise.
* modules/fcntl-h: Likewise.
* modules/gethrxtime: Likewise.
* modules/gettime: Likewise.
* modules/ignore-value: Likewise.
* modules/inet_ntop: Likewise.
* modules/inet_pton: Likewise.
* modules/inttypes: Likewise.
* modules/isnand-nolibm: Likewise.
* modules/isnanf-nolibm: Likewise.
* modules/mbchar: Likewise.
* modules/mbfile: Likewise.
* modules/mbiter: Likewise.
* modules/mbuiter: Likewise.
* modules/netdb: Likewise.
* modules/netinet_in: Likewise.
* modules/nproc: Likewise.
* modules/pagealign_alloc: Likewise.
* modules/poll: Likewise.
* modules/printf-frexp: Likewise.
* modules/pthread: Likewise.
* modules/putenv: Likewise.
* modules/random_r: Likewise.
* modules/relocatable-prog: Likewise.
* modules/search: Likewise.
* modules/select: Likewise.
* modules/selinux-h: Likewise.
* modules/settime: Likewise.
* modules/signal: Likewise.
* modules/size_max: Likewise.
* modules/socklen: Likewise.
* modules/ssize_t: Likewise.
* modules/stdarg: Likewise.
* modules/stdbool: Likewise.
* modules/stddef: Likewise.
* modules/stdint: Likewise.
* modules/stdio: Likewise.
* modules/stdlib: Likewise.
* modules/string: Likewise.
* modules/strings: Likewise.
* modules/sys_file: Likewise.
* modules/sys_ioctl: Likewise.
* modules/sys_select: Likewise.
* modules/sys_socket: Likewise.
* modules/sys_stat: Likewise.
* modules/sys_time: Likewise.
* modules/sys_times: Likewise.
* modules/sys_utsname: Likewise.
* modules/sys_wait: Likewise.
* modules/sysexits: Likewise.
* modules/time: Likewise.
* modules/times: Likewise.
* modules/tmpfile: Likewise.
* modules/trim: Likewise.
* modules/unistd: Likewise.
* modules/wchar: Likewise.
* modules/wctype: Likewise.
2009-09-17 Bruno Haible
Make getdate.y compile on QNX and NetBSD 5 / i386.
* m4/getdate.m4 (gl_GETDATE): Conditionally define
TIME_T_FITS_IN_LONG_INT.
* lib/getdate.y (long_time_t): New type.
(relative_time): Change type of 'seconds' field to long_time_t.
(get_date): Update types of local variables. Check against overflow
during conversion from long_time_t to time_t.
Reported by Matt Kraai
and Hasso Tepper .
2009-09-17 Bruno Haible
* modules/COPYING: Update copyright years.
* modules/README: Likeiwse.
* doc/gnulib-intro.texi (Copyright): Use a wildcard year.
Reported by Ian Beckwith .
2009-09-17 Ian Beckwith (tiny change)
* users.txt: Update references for gnuit package.
2009-09-17 Ian Beckwith (tiny change)
* m4/getdelim.m4: Fix typo in copyright line.
2009-09-17 Bruno Haible
* lib/atoll.c: Use the standard header with GPL copyright.
* lib/argz.in.h: Likewise.
* lib/glob.c: Likewise.
* lib/glob-libc.h: Likewise.
* lib/random_r.c: Likewise.
* lib/siglist.h: Likewise.
* lib/strsignal.c: Likewise.
Reported by Ian Beckwith .
2009-09-17 Eric Blake
rmdir: ensure correct dependency order
* m4/rmdir.m4 (gl_FUNC_RMDIR): Require unistd defaults.
2009-09-17 Bruno Haible
Disable assertion that fails on NetBSD 5 / i386.
* lib/mktime.c (ydhms_diff): Disable assertion about time_t size.
Reported by Sam Steingold
and Hasso Tepper .
2009-09-16 Eric Blake
unlinkdir: port to mingw
* m4/unlinkdir.m4 (gl_UNLINKDIR): Add mingw to list of platforms
on which no one can unlink a directory.
stdlib: sort witness names
* modules/stdlib (Makefile.am): Sort replacements.
* m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Likewise.
* lib/stdlib.in.h: Likewise.
parse-duration-tests: avoid link failure
* modules/parse-duration-tests (test_parse_duration_LDADD): Add
LIBINTL.
Reported by Tom G. Christensen.
openat-tests: ensure unlinkat behaves like rmdir
* tests/test-rmdir.c (main): Factor guts...
* tests/test-rmdir.h (test_rmdir_func): ...into new file.
* modules/rmdir-tests (Files): Ship new file.
* modules/openat-tests: New test.
* tests/test-unlinkat.c: Likewise.
rmdir-errno: mark obsolete, it is unsafe for cross-compilation
* modules/rmdir-errno (Status, Notice): Now obsolete.
rmdir: work around cygwin 1.5.x and mingw bugs
* m4/rmdir.m4 (gl_FUNC_RMDIR): Detect the bugs.
* lib/rmdir.c (rmdir): Work around it.
* modules/rmdir (Status, Notice): No longer obsolete.
(Files): Add dos.m4.
(Depends-on): Add unistd.
(configure.ac): Set witnesses.
(License): Relax to LGPLv2+.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Set defaults.
* modules/unistd (Makefile.am): Substitute witnesses.
* lib/unistd.in.h (rmdir): Declare replacement.
* doc/posix-functions/rmdir.texi (rmdir): Document this.
* modules/rmdir-tests: New tests.
* tests/test-rmdir.c: Likewise.
2009-09-15 Eric Blake
fchdir: improve use of replacement functions
* m4/fchdir.m4 (gl_FUNC_FCHDIR): Set appropriate witnesses.
* m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Add REPLACE_FSTAT.
* m4/dirent_h.m4 (gl_DIRENT_H_DEFAULTS): Add REPLACE_OPENDIR,
REPLACE_CLOSEDIR.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Add REPLACE_DUP.
* modules/sys_stat (Makefile.am): Substitute correct witness.
* modules/dirent (Makefile.am): Likewise.
* modules/unistd (Makefile.am): Likewise.
* lib/dirent.in.h (opendir, closedir): Use better witnesses.
* lib/unistd.in.h (dup): Likewise.
* lib/sys_stat.in.h (fstat): Likewise.
maint: ignore gnulib-tool temp files
* .gitignore: Ignore files created during gnulib-tool --test.
2009-09-13 Jim Meyering
posixtm: don't reject a time that specify "60" as the number of seconds
* lib/posixtm.c (posixtime): The code to reject invalid dates
would also reject a time specified with the .60 suffix.
But POSIX allows that, in order to accommodate leap seconds.
So don't reject it.
(main): Adjust tests accordingly.
* modules/posixtm (Depends-on): Add stpcpy.
2009-09-11 Jim Meyering
announce-gen: include [$release_type] in emitted Subject:
* build-aux/announce-gen (get_tool_versions): Include [$release_type],
e.g., [stable] in the emitted Subject: line.
2009-09-10 Ralf Wildenhues
Remove obsolete macros from several modules.
* m4/c-stack.m4 (AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC): Replace
obsolete Autoconf macros with their modern counterparts.
* m4/check-math-lib.m4 (gl_CHECK_MATH_LIB): Likewise.
* m4/gc-camellia.m4 (gl_GC_CAMELLIA): Likewise.
* m4/getaddrinfo.m4 (gl_GETADDRINFO): Likewise.
* m4/getdate.m4 (gl_C_COMPOUND_LITERALS): Likewise.
* m4/gethostname.m4 (gl_FUNC_GETHOSTNAME): Likewise.
* m4/getline.m4 (gl_FUNC_GETLINE): Likewise.
* m4/getopt.m4 (gl_GETOPT_CHECK_HEADERS): Likewise.
* m4/isfinite.m4 (gl_ISFINITEL_WORKS): Likewise.
* m4/poll.m4 (gl_FUNC_POLL): Likewise.
* m4/readline.m4 (gl_FUNC_READLINE): Likewise.
* m4/round.m4 (gl_FUNC_ROUND): Likewise.
* m4/roundf.m4 (gl_FUNC_ROUNDF): Likewise.
* m4/select.m4 (gl_FUNC_SELECT): Likewise.
* m4/sockets.m4 (gl_SOCKETS): Likewise.
* m4/socklen.m4 (gl_TYPE_SOCKLEN_T): Likewise.
* m4/sockpfaf.m4 (gl_SOCKET_FAMILIES): Likewise.
* m4/sysexits.m4 (gl_SYSEXITS): Likewise.
* m4/time_r.m4 (gl_TIME_R): Likewise.
* m4/tsearch.m4 (gl_FUNC_TSEARCH): Likewise.
* m4/vararrays.m4 (AC_C_VARARRAYS): Likewise.
* m4/wctype.m4 (gl_WCTYPE_H): Likewise.
Fix copyright header in build-aux scripts.
* build-aux/git-version-gen: Fix copyright header to match GPLv3
recommendation.
* build-aux/ncftpput-ftp: Likewise.
* build-aux/update-copyright: Likewise.
2009-09-09 Eric Blake
test-link: allow Linux choice of errno
* tests/test-link.c (main): Relax test for alternate error.
strndup: fix improper m4 caching
* m4/strndup.m4 (gl_FUNC_STRNDUP): Rework to avoid side effects
inside AC_CACHE_CHECK. Use REPLACE_STRNDUP, not HAVE_STRNDUP.
(gl_PREREQ_STRNDUP): Delete.
* m4/string_h.m4 (gl_HEADER_STRING_H_DEFAULTS): Update default.
* modules/string (Makefile.am): Substitute it.
* lib/string.in.h (strndup): Modernize prototype.
getcwd: port to mingw
* m4/getcwd.m4 (gl_FUNC_GETCWD): Mingw directories are very
different from the POSIX assumptions made throughout the getcwd
module; fortunately, the mingw getcwd does not need replacement.
(gl_FUNC_GETCWD_NULL): Skip test on mingw.
* modules/getcwd-tests: New test.
* tests/test-getcwd.c: Likewise.
link: fix platform bugs
* m4/link.m4 (gl_FUNC_LINK): Detect Solaris and Cygwin bugs.
* lib/link.c (link): Work around them. Fix related mingw bug.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Add REPLACE_LINK.
* modules/unistd (Makefile.am): Substitute it.
* lib/unistd.in.h (link): Declare replacement.
* doc/posix-functions/link.texi (link): Document this.
* modules/link (Depends-on): Add strdup-posix, sys_stat.
test-link: consolidate into single C program, test more cases
* tests/test-link.sh: Delete.
* tests/test-link.c: Test more error conditions. Exposes bugs on
at least Cygwin and Solaris.
* modules/link-tests (Files): Remove unused file.
(Depends-on): Add errno, sys_stat.
(Makefile.am): Simplify.
2009-09-08 Bruno Haible
Work around towlower, towupper bug on mingw.
* lib/wctype.in.h (towlower, towupper) [__MINGW32__]: New replacements.
* m4/wctype.m4 (gl_WCTYPE_H): Replace also on mingw.
* doc/posix-functions/towlower.texi: Mention the mingw bug.
* doc/posix-functions/towupper.texi: Likewise.
Reported by Eric Blake.
2009-09-08 Jim Meyering
build: don't try to run autoheader if we don't use it
* build-aux/bootstrap: Define AUTOHEADER=true when AC_CONFIG_HEADERS
is not used in configure.ac.
2009-09-08 Eric Blake
euidaccess: fix compilation error
* lib/euidaccess.c (includes): Add , for AT_EACCESS.
rawmemchr: relax license
* modules/rawmemchr (License): Derived from glibc, so LGPLv2+ is
okay.
Reported by Jim Meyering.
mkfifoat: new module
* modules/mkfifoat: New file.
* lib/mkfifoat.c: Likewise.
* m4/mkfifoat.m4 (gl_FUNC_MKFIFOAT): Likewise.
* m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Add witnesses.
* modules/sys_stat (Makefile.am): Use them.
* lib/sys_stat.in.h (mkfifoat, mknodat): Declare them.
* MODULES.html.sh (File system functions): Mention module.
* doc/posix-functions/mkfifoat.texi (mkfifoat): Likewise.
* doc/posix-functions/mknodat.texi (mknodat): Likewise.
* modules/mkfifoat-tests: New test.
* tests/test-mkfifoat.c: Likewise.
strchrnul: relax license
* modules/strchrnul (License): Derived from glibc, so LGPLv2+ is
okay.
Reported by Jim Meyering.
2009-09-08 Eric Blake
fstatat: fix compilation on Solaris
* lib/fstatat.c (includes): Add fcntl.h.
Reported by Pádraig Brady.
2009-09-07 Eric Blake
rename: modernize replacement
* modules/rename (Depends-on): Add stdio.
(configure.ac): Declare witness.
* m4/rename.m4 (gl_FUNC_RENAME): Ensure dependency order, and let
stdio take care of replacement.
* m4/stdio_h.m4 (gl_STDIO_H_DEFAULTS): Add new defaults.
* modules/stdio (Makefile.am): Substitute them.
* lib/stdio.in.h (rename): Declare replacement.
* lib/rename.c (includes): Allow cross-compilation to non-windows
machines.
* doc/posix-functions/rename.texi (rename): Improve
documentation.
stdio: sort witness names
* modules/stdio (Makefile.am): Sort replacements.
* m4/stdio_h.m4 (gl_STDIO_H_DEFAULTS): Likewise.
* lib/stdio.in.h: Likewise.
getcwd: minor cleanups
* lib/getcwd.c (AT_FDCWD): Delete; rely on instead.
(is_ENAMETOOLONG): Delete; ENAMETOOLONG is portable.
openat: provide more convenience names
* modules/faccessat (configure.ac): Add C witness.
* lib/unistd.in.h (readlinkat): Fix typo.
* lib/openat.h (statat, lstatat, accessat, euidaccessat): New
convenience wrappers.
* top/maint.mk (sc_prohibit_openat_without_use): Allow these
wrappers in syntax checks.
2009-09-06 Eric Blake
doc: fix comments in recent patches
* lib/faccessat.c: Mention correct function.
* lib/fchmodat.c: Likewise.
* lib/fchownat.c: Likewise.
* lib/symlinkat.c: Likewise.
* doc/posix-headers/fcntl.texi (fcntl.h): Cygwin 1.7 has AT_*
constants.
faccessat, symlinkat: continue cleanup of previous patch
* m4/symlinkat.m4 (gl_FUNC_SYMLINKAT): Ensure dependency order.
* m4/faccessat.m4 (gl_FUNC_FACCESSAT): Likewise.
* modules/unistd (Makefile.am): Substitute GNULIB_READLINKAT.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Offer GNULIB_READLINKAT.
* modules/symlinkat (configure.ac): Set GNULIB_READLINKAT.
* lib/unistd.in.h (readlinkat): Declare if GNULIB_READLINKAT is
set.
2009-09-06 Bruno Haible
* lib/sys_stat.in.h (fchmodat): Declare if GNULIB_FCHMODAT is set.
(fstatat): Declare if GNULIB_FSTATAT is set.
(mkdirat): Declare if GNULIB_MKDIRAT is set.
* lib/unistd.in.h (fchownat): Declare if GNULIB_FCHOWNAT is set.
(unlinkat): Declare if GNULIB_UNLINKAT is set.
* modules/fcntl-h (Files): Remove m4/openat.m4.
* modules/sys_stat (Files): Remove m4/openat.m4.
(Makefile.am): Substitute GNULIB_FCHMODAT, GNULIB_FSTATAT,
GNULIB_MKDIRAT instead of GNULIB_OPENAT.
* modules/unistd (Files): Remove m4/openat.m4.
(Makefile.am): Substitute GNULIB_FCHOWNAT, GNULIB_UNLINKAT instead of
GNULIB_OPENAT.
* m4/fcntl_h.m4 (gl_FCNTL_H_DEFAULTS): Initialize GNULIB_OPENAT,
HAVE_OPENAT here. Don't require gl_OPENAT_DEFAULTS.
* m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Initialize
GNULIB_FCHMODAT, GNULIB_FSTATAT, GNULIB_MKDIRAT, HAVE_FCHMODAT,
HAVE_FSTATAT, HAVE_MKDIRAT, REPLACE_FSTATAT here. Don't require
gl_OPENAT_DEFAULTS.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize GNULIB_FCHOWNAT,
GNULIB_UNLINKAT, HAVE_FCHOWNAT, HAVE_UNLINKAT, REPLACE_FCHOWNAT here.
Don't require gl_OPENAT_DEFAULTS.
* m4/openat.m4 (gl_FUNC_OPENAT): Require gl_FCNTL_H_DEFAULTS,
gl_SYS_STAT_H_DEFAULTS, gl_UNISTD_H_DEFAULTS. Set GNULIB_FCHMODAT,
GNULIB_FSTATAT, GNULIB_MKDIRAT, GNULIB_FCHOWNAT, GNULIB_UNLINKAT.
(gl_OPENAT_DEFAULTS): Remove macro.
2009-09-06 Bruno Haible
* modules/openat (configure.ac): Remove unneeded witness.
2009-09-06 Bruno Haible
Set errno to ENOSYS when a function is entirely unsupported.
* lib/chown.c (rpl_chown) [!HAVE_CHOWN]: Set errno to ENOSYS instead of
EOPNOTSUPP.
* lib/lchown.c (lchown) [!HAVE_CHOWN]: Likewise.
* modules/chown (Depends-on): Remove errno.
2009-09-06 Bruno Haible
* doc/posix-headers/fcntl.texi (AT_*): Mention affected platforms.
2009-09-06 Bruno Haible
* lib/sys_stat.in.h: Fix preprocessor command indentation.
2009-09-06 Ben Pfaff
Bruno Haible
Work around a glibc bug in strtok_r.
* lib/string.in.h (strtok_r): Replace if REPLACE_STRTOK_R is set.
Undefine if UNDEFINE_STRTOK_R is set.
* lib/strtok_r.c (strtok_r, __strtok_r) [!_LIBC]: Don't undefine.
* m4/string_h.m4 (gl_HEADER_STRING_H_DEFAULTS): Initialize
REPLACE_STRTOK_R and UNDEFINE_STRTOK_R.
* m4/strtok_r.m4 (gl_FUNC_STRTOK_R): Check against the glibc bug.
* modules/string (Makefile.am): Substitute REPLACE_STRTOK_R,
UNDEFINE_STRTOK_R.
* doc/posix-functions/strtok_r.texi: Mention the glibc 2.7 bug.
2009-09-06 Sergey Poznyakoff
exclude: minor fix
* lib/exclude.c: Include wctype.h
2009-09-06 Akim Demaille
bootstrap: improve error message
* build-aux/bootstrap (find_tool): Upon failure, report the list
of candidates.
Honor the initial value of the envvar.
2009-09-05 Eric Blake
symlinkat: new module
* modules/symlinkat: New file.
* lib/symlinkat.c: Likewise.
* m4/symlinkat.m4 (gl_FUNC_SYMLINKAT): Likewise.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Add witnesses.
* modules/unistd (Makefile.am): Use them.
* lib/unistd.in.h (symlinkat, readlinkat): Declare them.
(faccessat) [GNULIB_POSIXCHECK]: Fix typo.
* lib/at-func.c (FUNC_RESULT): New macro, defaulting to int.
* MODULES.html.sh (File system functions): Mention module.
* doc/posix-functions/symlinkat.texi (symlinkat): Likewise.
* doc/posix-functions/readlinkat.texi (readlinkat): Likewise.
* modules/symlinkat-tests: New test.
* tests/test-symlinkat.c: Likewise.
test-openat-safer: add more checks
* tests/test-openat-safer.c (main): Check more code paths.
2009-09-05 Jim Meyering
syntax-check: detect unnecessary inclusion of openat.h
* top/maint.mk (sc_prohibit_openat_without_use): New rule.
2009-09-05 Bruno Haible
Support towlower, towupper.
* doc/posix-functions/towlower.texi: Mention module wctype.
* doc/posix-functions/towupper.texi: Likewise.
* lib/wctype.in.h (towlower, towupper): New functions.
* tests/test-wctype.c: Include stdio.h, stdlib.h.
(ASSERT): New macro.
(e): New variable.
(main): Test also towlower, towupper. Test WEOF argument.
Reported by Alan Hourihane .
2009-09-05 Bruno Haible
Fix conversion behaviour when the input is invalid.
* lib/striconveh.c (mem_cd_iconveh_internal): Fix storing of question
mark occurring in first pass of indirect conversion.
* tests/test-striconveh.c (main): Test conversion of invalid ASCII
input.
Found by clang's static analyzer.
2009-09-05 Bruno Haible
* tests/test-striconveh.c (main): Test indirect conversion on platforms
where direct conversion is possible.
2009-09-04 Eric Blake
openat: fail with ENOENT on empty name
* lib/openat-proc.c (openat_proc_name): Special-case the empty
buffer.
link-follow: fix logic bug in prior patch
* m4/link-follow.m4 (gl_FUNC_LINK_FOLLOWS_SYMLINK): Fix bug that
reversed sense of yes and no in prior patch. Avoid confusing
compilation failure with desired semantics.
link-follow: accomodate mingw and cross-compilation
* m4/link-follow.m4 (gl_AC_FUNC_LINK_FOLLOWS_SYMLINK): Rename...
(gl_FUNC_LINK_FOLLOWS_SYMLINK): ...to this. Change
cross-compilation results to -1, to make linkat easier to
implement when cross-compiling. Trivially support mingw.
* modules/link-follow (configure.ac): Call new name.
* NEWS: Mention this.
2009-09-03 Eric Blake
faccessat: compile replacement
* m4/faccessat.m4 (gl_FUNC_FACCESSAT): Build replacement when
needed.
fts: fix compilation error
* lib/fts.c (includes): Re-add "openat.h", for
openat_needs_fchdir.
faccessat: new module
* modules/faccessat: New file.
* lib/faccessat.c: Likewise.
* m4/faccessat.m4 (gl_FUNC_FACCESSAT): Likewise.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Add witness.
* modules/unistd (Makefile.am): Use it.
* lib/unistd.in.h (faccessat): Declare it.
(F_OK, X_OK, W_OK, R_OK): Provide definitions.
* lib/fcntl.in.h (AT_SYMLINK_FOLLOW, AT_EACCESS): Likewise.
* MODULES.html.sh (File system functions): Mention it.
* doc/posix-functions/faccessat.texi (faccessat): Likewise.
* doc/posix-headers/fcntl.texi (fcntl.h): Likewise.
euidaccess: prefer POSIX over non-standard implementation
* m4/euidaccess.m4 (gl_PREREQ_EUIDACCESS): Check for faccessat.
* lib/euidaccess.c (euidaccess): Use it if available.
openat: make template easier to use
* lib/at-func.c (CALL_FUNC): Allow AT_FUNC_USE_F1_COND and
AT_FUNC_F2 to be undefined.
(VALIDATE_FLAG): New macro; use it to reject bad flags.
(AT_FUNC_USE_F1_COND): Change sense to just flag bit.
* lib/fchmodat.c (AT_FUNC_USE_F1_COND): Adjust.
* lib/fchownat.c (AT_FUNC_USE_F1_COND): Likewise.
* lib/openat.c (AT_FUNC_USE_F1_COND) [fstatat, unlinkat]:
Likewise.
* lib/mkdirat.c (AT_FUNC_F2, AT_FUNC_USE_F1_COND): Delete.
* lib/selinux-at.c (AT_FUNC_F2, AT_FUNC_USE_F1_COND)
[getfileconat, lgetfileconat, setfileconat, lsetfileconat]:
Likewise.
openat: declare in POSIX headers
* NEWS: Mention this.
* modules/openat (configure.ac): Declare witnesses.
(Depends-on): Add fcntl-h, sys_stat, unistd.
(Include): Mention correct headers.
* modules/fcntl-h (Depends-on): Add link-warning.
(Files): Add openat.m4.
(Makefile.am): Substitute witnesses.
* modules/sys_stat (Files, Makefile.am): Likewise.
* modules/unistd (Files, Makefile.am): Likewise.
* m4/openat.m4 (gl_FUNC_OPENAT, gl_FUNC_FCHOWNAT): Set witnesses.
(gl_OPENAT_DEFAULTS): New macro.
* m4/fcntl_h.m4 (gl_FCNTL_H_DEFAULTS): Use it.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Likewise.
* m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Likewise.
(SYS_STAT_H): Remove unused variable.
* doc/posix-headers/fcntl.texi (fcntl.h): Update content.
* lib/fcntl--.h (includes): Remove unneeded header.
* lib/openat-safer.c (includes): Likewise.
* lib/openat.h (AT_FDCWD, AT_SYMLINK_NOFOLLOW, AT_REMOVEDIR)
(openat, fstatat, unlinkat, mkdirat, fchmodat, fchownat): Move to
appropriate headers.
(__OPENAT_PREFIX): Delete.
* lib/fcntl.in.h (openat): Provide declaration.
(AT_FDCWD): Fix Solaris bug.
(AT_SYMLINK_NOFOLLOW, AT_REMOVEDIR): Provide macros.
* lib/sys_stat.in.h (fstatat, mkdirat): Provide declaration.
* lib/fchmodat.c (includes): Adjust to find declaration.
* lib/fchownat.c (includes): Likewise.
* lib/mkdirat.c (includes): Likewise.
* lib/fstatat.c (includes): Likewise. Ensure original fstatat is
still visible.
2009-09-02 Eric Blake
errno: use consistently
* lib/c-stack.c (ENOTSUP): guarantees a definition.
* lib/canonicalize-lgpl.c (ENAMETOOLONG): Likewise.
* lib/canonicalize.c (ELOOP): Likewise.
* lib/inet_ntop.c (EAFNOSUPPORT): Likewise.
* lib/inet_pton.c (EAFNOSUPPORT): Likewise.
* lib/lchown.c (EOPNOTSUPP): Likewise.
* lib/openat-priv.h (ENOSYS, EOPNOTSUPP): Likewise.
* lib/savewd.c (ESTALE): Likewise.
* lib/settime.c (ENOSYS): Likewise.
* lib/utimens.c (ENOSYS): Likewise.
* lib/xgethostname.c (ENAMETOOLONG): Likewise.
* lib/chdir-safer.c (ELOOP): Likewise.
(chdir_no_follow): Use HAVE_READLINK, not ELOOP, as witness.
* modules/c-stack (Depends-on): Add errno.
* modules/canonicalize (Depends-on): Likewise.
* modules/chdir-safer (Depends-on): Likewise.
* modules/fdopendir (Depends-on): Likewise.
* modules/inet_ntop (Depends-on): Likewise.
* modules/inet_pton (Depends-on): Likewise.
* modules/lchown (Depends-on): Likewise.
* modules/openat (Depends-on): Likewise.
* modules/savewd (Depends-on): Likewise.
* modules/settime (Depends-on): Likewise.
* m4/chdir-safer.m4 (gl_CHDIR_SAFER): Check for readlink.
fts: avoid leaking fds
* modules/fts (Depends-on): Add cloexec.
* lib/fts.c (opendirat, diropen, fts_build): Set close-on-exec
flag.
fts: make directory fds more robust
* lib/fts.c (O_DIRECTORY): Let take care of this.
(opendirat): Specify O_DIRECTORY, and add fallbacks for safety.
backupfile, chdir-long, fts, savedir: make safer
* lib/backupfile.c (includes): Use "dirent--.h", since
numbered_backup can write to stderr during readdir.
* lib/savedir.c (includes): Likewise.
* lib/chdir-long.c (includes): Use "fcntl--.h", since openat
emulation can write to stderr on failure.
* lib/fts.c (includes) [!_LIBC]: Likewise for opendir and openat.
* lib/getcwd.c: Document why opendir_safer is unused.
* lib/glob.c: Likewise.
* lib/scandir.c: Likewise.
* lib/openat-proc.c: Likewise, for open_safer.
* modules/backupfile (Depends-on): Add dirent-safer.
* modules/savedir (Depends-on): Likewise.
* modules/fts (Depends-on): Add dirent-safer and openat-safer.
* modules/chdir-long (Depends-on): Add openat-safer.
openat-safer: new module
* modules/openat-safer: New file.
* lib/openat-safer.c: Likewise.
* m4/fcntl-safer.m4 (gl_OPENAT_SAFER): New macro.
* lib/fcntl-safer.h (openat_safer): Declare.
* lib/fcntl--.h (openat): Override.
* MODULES.html.sh (File descriptor based I/O): Mention it.
* lib/openat.h: Add double-inclusion guards.
* lib/openat.c (includes): Only include "fcntl-safer.h", not
"fcntl--.h", so we can implement openat.
* modules/openat-safer-tests: New test.
* tests/test-openat-safer.c: New file.
dirent-safer: new module
* modules/dirent-safer: New file.
* lib/dirent--.h: Likewise.
* lib/dirent-safer.h: Likewise.
* lib/opendir-safer.c: Likewise.
* m4/dirent-safer.m4: Likewise.
* MODULES.html.sh (Enhancements for POSIX:2008): Mention it.
* modules/dirent-safer-tests: New test.
* tests/test-dirent-safer.c: New file.
* lib/fdopendir.c (includes): Ensure fdopendir is also safe.
fdopendir: optimize on mingw
* lib/unistd.in.h (_gl_directory_name): New prototype.
* lib/fchdir.c (_gl_directory_name): Implement it.
(fchdir): Use it to simplify implementation.
* lib/fdopendir.c (fdopendir) [REPLACE_FCHDIR]: Use metadata from
fchdir, when available, to avoid calling [f]chdir().
fdopendir: split into its own module
* lib/openat.c (fdopendir): Move...
* lib/fdopendir.c: ...into new file.
* modules/fdopendir: New module.
* m4/fdopendir.m4 (gl_FUNC_FDOPENDIR): New file.
* modules/openat (Depends-on): Add fdopendir.
* m4/openat.m4 (gl_FUNC_OPENAT): No longer need to check for
fdopendir here.
* modules/savedir (Depends-on): Only need fdopendir, not full
openat.
* lib/savedir.c (include): Use , not "openat.h".
* lib/openat.h (fdopendir): Drop prototype.
* lib/dirent.in.h (fdopendir): Provide prototype.
* m4/dirent_h.m4 (gl_DIRENT_H_DEFAULTS): Add replacements.
* modules/dirent (Makefile.am): Substitute them.
* MODULES.html.sh (File system functions): Mention it.
* doc/posix-functions/fdopendir.texi (fdopendir): Likewise.
* modules/fdopendir-tests: New file.
* tests/test-fdopendir.c: Likewise.
fchdir: use more consistent macro convention
* lib/fcntl.in.h (_gl_register_fd): Move declaration to unistd.
* lib/sys_stat.in.h (rpl_fstat): Declare via make-time
REPLACE_FCHDIR, rather than relying on config.h macros.
* lib/unistd.in.h (fchdir): Move all fchdir internal declarations
inside a single make-time REPLACE_FCHDIR block, rather than using
the config.h FCHDIR_REPLACEMENT.
* m4/fchdir.m4 (gl_FUNC_FCHDIR): REPLACE_FCHDIR was already
AC_SUBST'd, also AC_DEFINE it. Don't define FCHDIR_REPLACEMENT.
Manage fstat replacement.
* m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Pick up
REPLACE_FCHDIR.
* modules/sys_stat (Files): Add m4/unistd_h.m4.
(Makefile.am): Substitute REPLACE_FCHDIR.
* lib/close.c (rpl_close): Use REPLACE_FCHDIR, not
FCHDIR_REPLACEMENT.
* lib/dup-safer.c (dup_safer): Likewise.
* lib/dup2.c (rpl_dup2): Likewise.
* lib/dup3.c (rpl_dup3): Likewise.
* lib/open.c (rpl_open): Likewise.
fchdir: simplify error handling, and support dup3
* modules/fchdir (Depends-on): Use strdup-posix, not strdup. Add
stdbool, malloc-posix, realloc-posix.
* lib/fchdir.c (struct dir_info_t): Delete saved_errno.
(ensure_dirs_slot): Return false on allocation failure.
(rpl_dup2): Delete.
(_gl_register_dup): New function.
(_gl_unregister_fd, rpl_opendir, rpl_dup): Update callers.
(_gl_register_fd): Close fd on allocation failure.
* lib/fcntl.in.h (_gl_register_fd): Update signature.
* lib/unistd.in.h (_gl_register_dup) [FCHDIR_REPLACEMENT]: New
prototype.
(rpl_dup2_fchdir): Delete prototype.
* lib/open.c (open): Update caller.
* lib/dup2.c (dup2): Track fchdir metadata.
* lib/dup3.c (dup3): Likewise.
* m4/dup2.m4 (gl_REPLACE_DUP2): New macro.
* m4/fchdir.m4 (gl_FUNC_FCHDIR): Use it.
2009-09-02 Ralf Wildenhues
* gnulib-tool (func_create_testdir, func_create_megatestdir): Use
AC_CONFIG_HEADERS instead of AM_CONFIG_HEADER. Use AC_CONFIG_FILES and
don't pass arguments to AC_OUTPUT.
2009-09-02 Bruno Haible
* modules/mkdtemp (License): Relicense under LGPLv2+.
Reported by Paolo Bonzini.
2009-09-02 Ralf Wildenhues
Replace uses of obsolete autoconf macros in Jim's modules.
The Autoconf macros AC_TRY_CPP, AC_TRY_COMPILE, AC_TRY_LINK and
AC_TRY_RUN have been obsolete since Autoconf 2.55, and each use
can evoke a warning from autoconf when run with -Wobsolete
enabled. They were declared obsolete for good reasons (see
the `AC_FOO_IFELSE vs AC_TRY_FOO' node in the Autoconf manual,
recently renamed to `AC_ACT_IFELSE vs AC_TRY_ACT'), and we
should not continue using the deprecated macros.
* m4/d-type.m4 (gl_CHECK_TYPE_STRUCT_DIRENT_D_TYPE): Replace
obsolete Autoconf macros with modern counterparts.
* m4/dirfd.m4 (gl_FUNC_DIRFD): Likewise.
* m4/dos.m4 (gl_AC_DOS): Likewise.
* m4/fpending.m4 (gl_FUNC_FPENDING): Likewise.
* m4/fsusage.m4 (gl_FILE_SYSTEM_USAGE): Likewise.
* m4/getloadavg.m4 (gl_PREREQ_GETLOADAVG): Likewise.
* m4/jm-winsz1.m4 (gl_WINSIZE_IN_PTEM): Likewise.
* m4/link-follow.m4 (gl_AC_FUNC_LINK_FOLLOWS_SYMLINK): Likewise.
* m4/ls-mntd-fs.m4 (gl_LIST_MOUNTED_FILE_SYSTEMS): Likewise.
* m4/mkdir-slash.m4 (gl_FUNC_MKDIR_TRAILING_SLASH): Likewise.
* m4/mode_t.m4 (gl_PROMOTED_TYPE_MODE_T): Likewise.
* m4/rename-dest-slash.m4 (gl_FUNC_RENAME_TRAILING_DEST_SLASH):
Likewise.
* m4/rename.m4 (gl_FUNC_RENAME): Likewise.
* m4/rmdir-errno.m4 (gl_FUNC_RMDIR_NOTEMPTY): Likewise.
* m4/rpmatch.m4 (gl_PREREQ_RPMATCH): Likewise.
* m4/st_dm_mode.m4 (AC_STRUCT_ST_DM_MODE): Likewise.
* m4/stat-time.m4 (gl_STAT_TIME): Likewise.
* m4/utimes-null.m4 (gl_FUNC_UTIMES_NULL): Likewise.
2009-09-01 Eric Blake
fchdir: fix off-by-one bug in previous patch
* lib/fchdir.c (rpl_fstat): Use correct bounds.
(_gl_unregister_fd): Delete useless if.
2009-09-01 Daniel P. Berrange
maint.mk: sort the list of syntax-check rules
* top/maint.mk (syntax-check-rules): Sort syntax-check rules, so it's
easier to get a sense of progress when the rules are run sequentially
and take a long time.
2009-09-01 Simon Josefsson
* modules/arpa_inet: Use $(MKDIR_P) instead of @MKDIR_P@.
* modules/netinet_in: Likewise.
* modules/sys_file: Likewise.
* modules/sys_ioctl: Likewise.
* modules/sys_select: Likewise.
* modules/sys_socket: Likewise.
* modules/sys_stat: Likewise.
* modules/sys_time: Likewise.
* modules/sys_times: Likewise.
* modules/sys_utsname: Likewise.
* modules/sys_wait: Likewise.
2009-09-01 Jim Meyering
fts: help ensure that return values are not ignored
* lib/fts_.h (__GNUC_PREREQ): Define.
(__attribute_warn_unused_result__): Define.
(fts_children, fts_close, fts_open, fts_read): Declare with
__attribute_warn_unused_result__.
fts: fts_close now fails also when closing a dir file descriptor fails
* lib/fts.c (fts_close): Detect close failure, not just fchdir failure,
and propagate to caller, along with errno.
announce-gen: correct formatting in --help output
* build-aux/announce-gen (usage): Move the one-line description in
--help output "up", to where it belongs, just after Usage:.
2009-08-31 Eric Blake
fchdir: port to mingw
* m4/fchdir.m4 (gl_FUNC_FCHDIR): Check for mingw bug.
* lib/open.c (open) [FCHDIR_REPLACEMENT]: If directories can't be
opened, then use a substitute.
* lib/sys_stat.in.h (fstat) [REPLACE_OPEN_DIRECTORY]: Declare
replacement.
* lib/fchdir.c (fstat) [REPLACE_OPEN_DIRECTORY]: Implement it.
(_gl_register_fd): No need to check stat if open already filters
all directories.
(fchdir): Fix error condition to match POSIX.
* modules/fchdir (Depends-on): Add sys_stat.
* doc/posix-functions/open.texi (open): Document the limitation.
* modules/fchdir-tests: New file.
* tests/test-fchdir.c: Likewise.
canonicalize: allow cross-testing from cygwin to mingw
* modules/canonicalize-tests (configure.ac): Define HAVE_SYMLINK.
(Makefile.am): Pass it through TESTS_ENVIRONMENT.
* modules/canonicalize-lgpl-tests (configure.ac, Makefile.am):
Likewise.
* tests/test-canonicalize.sh: Also skip test if 'ln -s' works, but
target does not support symlinks.
* tests/test-canonicalize-lgpl.sh: Likewise.
chown: avoid compilation warning on mingw
* m4/chown.m4 (gl_FUNC_CHOWN): Recognize missing chown.
* lib/chown.c (rpl_chown) [!HAVE_CHOWN]: Always return failure on
mingw.
* lib/lchown.c (lchown) [!HAVE_CHOWN]: Likewise.
* modules/chown (Depends-on): Add errno.
2009-08-31 Stefano Lattarini (tiny change)
* gnulib-tool: Fix test whether $CONFIG_SHELL has a working 'echo'
command.
2009-08-31 Jim Meyering
canonicalize: remove useless initialization
* lib/canonicalize.c (canonicalize_filename_mode): Remove useless
initialization of local, "end".
2009-08-30 Bruno Haible
Fix an unnecessary error on Solaris 10 on NFSv3 file systems.
* lib/set-mode-acl.c (qset_acl) [Solaris 10 new]: Treat EOPNOTSUPP like
ENOSYS.
2009-08-30 Bruno Haible
* tests/test-pipe-filter-ii1.sh: Prefer /usr/xpg6/bin/tr over
/usr/xpg4/bin/tr when it exists.
* tests/test-pipe-filter-gi1.sh: Likewise.
2009-08-30 Bruno Haible
Work around deficient /usr/bin/id program on Solaris.
* tests/test-file-has-acl.sh (ID): New variable.
* tests/test-set-mode-acl.sh (ID): Likewise.
* tests/test-copy-acl.sh (ID): Likewise.
* tests/test-copy-file.sh (ID): Likewise.
2009-08-30 Bruno Haible
New module 'xstriconveh'.
* lib/xstriconveh.h: New file.
* lib/xstriconveh.c: New file.
* modules/xstriconveh: New file.
2009-08-30 Bruno Haible
Make it easier to use mem_cd_iconveh.
* lib/striconveh.h (iconveh_t): New type.
(iconveh_open, iconveh_close): New declarations.
(mem_cd_iconveh, str_cd_iconveh): Replace the three iconv_t arguments
with a single 'const iconveh_t *' argument.
* lib/striconveh.c (iconveh_open, iconveh_close): New functions.
(mem_cd_iconveh, str_cd_iconveh): Replace the three iconv_t arguments
with a single 'const iconveh_t *' argument.
(mem_iconveh, str_iconveh): Use iconveh_open, iconveh_close.
* tests/test-striconveh.c (main): Update.
* NEWS: Mention the change.
2009-08-30 Bruno Haible
* doc/posix-functions/iconv_open.texi: Mention indirect conversion
problem.
2009-08-30 Bruno Haible
Work around iconv_open problem on Solaris.
* lib/iconv_open-solaris.gperf: New file.
* lib/iconv_open.c (ICONV_FLAVOR_SOLARIS): New macro.
* m4/iconv_open.m4 (gl_FUNC_ICONV_OPEN): Also handle Solaris.
* modules/iconv_open (Files): Add lib/iconv_open-solaris.gperf.
(Makefile.am): Add rule for iconv_open-solaris.h. Augment
BUILT_SOURCES, MOSTLYCLEANFILES, MAINTAINERCLEANFILES, EXTRA_DIST.
* doc/posix-functions/iconv_open.texi: Mention the Solaris problem.
2009-08-29 Jim Meyering
maint.mk: remove more coreutils-specific targets; XZ_OPT=-9ev
* top/maint.mk (cvs-check): Remove target; it was just an alias
to the better-named vc-diff-check.
(maintainer-distcheck): Remove rule. It was used only from
the (alpha/beta/major) target, and all of its commands but one
were coreutils-specific.
(vc-dist): Remove rule.
(alpha beta major): Run "$(MAKE) distcheck" explicitly.
Run vc-diff-check, not vc-dist.
Run $(MAKE) dist with XZ_OPT=-9ev. Note spelling, with "-".
2009-08-27 Bruno Haible
* tests/test-bitrotate.c (main): Remove test that uses a shift count
of 0.
2009-08-27 Bruno Haible
* tests/test-func.c (main): Don't verify sizeof __func__ on SunPRO C
compilers.
* doc/func.texi: Document the SunPRO C bug.
2009-08-27 Bruno Haible
Fix link error on Solaris.
* tests/test-parse-duration.c (xstrdup): Remove function.
2009-08-26 Pádraig Brady
ignore-value: handle pointer types, too
* lib/ignore-value.h (__attribute__): Remove definition.
(ignore_value): Remove use of "__attribute__ ((unused))" in favor
of a more concise and more-often effective "(void) i" statement.
(ignore_ptr): New function to suppress warnings from functions that
return pointers, and to make it explicit that one function doesn't
handle all cases.
2009-08-25 Bruno Haible
dup2: work around a Linux bug.
* m4/dup2.m4 (gl_FUNC_DUP2): Test for the Linux bug.
* lib/dup2.c (rpl_dup2): Correct the return value if it is -EBADF.
* doc/posix-functions/dup2.texi: Mention the Linux bug.
Reported by Simon Josefsson.
2009-08-25 Jim Meyering
libguestfs uses gnulib
* users.txt: Add libguestfs.
2009-08-24 Eric Blake
dup2, pipe2: fix some recent test failures on cygwin 1.5.x
* lib/pipe2.c (includes): Add binary-io.h.
* lib/dup2.c (rpl_dup2): Correct buggy errno value.
2009-08-24 Bruno Haible
Tolerate declared but missing accept4 syscall.
* lib/accept4.c (accept4): Invoke original accept4 function first, if
available.
* lib/sys_socket.in.h (accept4): If the function is already present,
override it.
* m4/accept4.m4 (gl_FUNC_ACCEPT4): Remove AC_LIBOBJ invocation.
* modules/accept4 (Makefile.am): Compile accept4.c always.
Reported by Paolo Bonzini and Eric Blake.
2009-08-23 Bruno Haible
New module 'accept4'.
* lib/sys_socket.in.h (accept4): New declaration.
* lib/accept4.c: New file.
* m4/accept4.m4: New file.
* m4/sys_socket_h.m4 (gl_SYS_SOCKET_H_DEFAULTS): Initialize
GNULIB_ACCEPT4, HAVE_ACCEPT4.
* modules/sys_socket (Makefile.am): Substitute GNULIB_ACCEPT4,
HAVE_ACCEPT4.
* modules/accept4: New file.
* doc/glibc-functions/accept4.texi: Mention the new module.
2009-08-24 Jim Meyering
progname: also set global program_invocation_name, when possible
Before this change, a libtool-enabled program that calls glibc's
error function would report the program name as
"/abs/dir/.libs/lt-program_name" rather than the desired program_name.
* modules/progname (configure.ac): Check for a declaration of
program_invocation_name.
* lib/progname.c: Include .
(set_program_name) [HAVE_DECL_PROGRAM_INVOCATION_NAME]:
Set program_invocation_name.
2009-08-23 Bruno Haible
* lib/dup3.c: Include .
2009-08-23 Bruno Haible
* lib/dup3.c (dup3): Test only once whether the system actually exists.
* lib/pipe2.c (pipe2): Likewise.
Suggested by Eric Blake.
2009-08-23 Bruno Haible
Tolerate declared but missing dup3 syscall.
* lib/dup3.c (dup3): Invoke original dup3 function first, if available.
* lib/unistd.in.h (dup3): If the function is already present,
override it.
* m4/dup3.m4 (gl_FUNC_DUP3): Remove AC_LIBOBJ invocation.
* modules/dup3 (Makefile.am): Compile dup3.c always.
Reported by Paolo Bonzini.
2009-08-23 Bruno Haible
Tolerate declared but missing pipe2 syscall.
* lib/pipe2.c (pipe2): Invoke original pipe2 function first, if
available.
* lib/unistd.in.h (pipe2): If the function is already present,
override it.
* m4/pipe2.m4 (gl_FUNC_PIPE2): Remove AC_LIBOBJ invocation.
* modules/pipe2 (Makefile.am): Compile pipe2.c always.
Reported by Paolo Bonzini.
2009-08-23 Bruno Haible
* lib/pipe2.c (pipe2): Move #ifs inside function.
2009-08-22 Joel E. Denny
quotearg: document limitations of quote_these_too
* lib/quotearg.c (quotearg_buffer_restyled): Add comments where
those limitations are created.
* lib/quotearg.h (set_char_quoting): Document that digits and
letters that are special after backslash are not permitted.
(quotearg_char): Cross-reference set_char_quoting documentation.
2009-08-23 Joel E. Denny
quotearg: implement custom_quoting_style
* lib/quotearg.c: (struct quoting_options): Add left_quote and
right_quote fields.
(set_custom_quoting): New public function.
(quotearg_buffer_restyled): Add left_quote and right_quote
arguments, handle them very much like locale quoting, and update
all uses.
(quotearg_n_custom): New public function.
(quotearg_n_custom_mem): New public function.
(quotearg_custom): New public function.
(quotearg_custom_mem): New public function.
* lib/quotearg.h: Prototype and document new public functions.
(enum quoting_style): For escape_quoting_style and
clocale_quoting_style, comment that QA_SPLIT_TRIGRAPHS is
ignored even though they're otherwise like c_quoting_style.
Add custom_quoting_style member and document with comparison to
clocale_quoting_style.
* tests/test-quotearg.c (custom_quotes): New array.
(custom_results): New array.
(main): Extend to test custom quoting.
2009-08-22 Joel E. Denny
quotearg: fix right quote escaping when it's in quote_these_too
* lib/quotearg.c (quotearg_buffer_restyled): Upon seeing a right
quote, be sure to prepend only one backslash.
* tests/test-quotearg.c (use_quote_double_quotes): New function.
(main): Test it.
2009-08-22 Joel E. Denny
quotearg-tests: test escaping of embedded locale quotes
* tests/test-quotearg.c (struct result_strings): Add member for
new input.
(LQ_ENC, RQ_ENC, RQ_ESC): New macros.
(inputs): Add new input.
(results_g): Add expected results.
(flag_results): Likewise.
(locale_results): Likewise.
(compare_strings): Check those.
2009-08-23 Bruno Haible
Tests for module 'dup3'.
* modules/dup3-tests: New file.
* tests/test-dup3.c: New file.
New module 'dup3'.
* lib/unistd.in.h (dup3): New declaration.
* lib/dup3.c: New file.
* m4/dup3.m4: New file.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize GNULIB_DUP3 and
HAVE_DUP3.
* modules/unistd (Makefile.am): Substitute GNULIB_DUP3 and HAVE_DUP3.
* modules/dup3: New file.
* doc/glibc-functions/dup3.texi: Mention the new module.
2009-08-23 Bruno Haible
Tweak the dup2 test.
* tests/test-dup2.c (main): Create the test file empty. Verify that an
out-of-range fd yields EBADF. Verify that after writing to /dev/null,
the test file is still empty. Fix argument order of lseek.
2009-08-23 Bruno Haible
Avoid test link errors when the modules getopt-gnu, gettext are used.
* modules/getopt-posix-tests (Makefile.am): Define test_getopt_LDADD.
Reported by Tom G. Christensen .
2009-08-23 Bruno Haible
Fix getdtablesize() on mingw.
* lib/getdtablesize.c (getdtablesize): Implement differently.
* lib/unistd.in.h (getdtablesize): Improve comment.
2009-08-23 Bruno Haible
New module 'mkostemp'.
Based on Ulrich Drepper's 2007-08-10 change in glibc.
* lib/stdlib.in.h (mksotemp): New declaration.
* lib/mkostemp.c: New file, from glibc with modifications.
* lib/tempname.h (GT_FILE): Remove outdated comment.
(gen_tempname): Add flags argument.
* lib/tempname.c (__GT_BIGFILE): Remove macro.
(__GT_FILE): Map to 1.
(small_open, large_open): Remove macros.
(__gen_tempname): Add flags argument. Remove code for __GT_BIGFILE.
* lib/mkstemp.c (mkstemp): Update.
* lib/mkdtemp.c (mkdtemp): Likewise.
* m4/mkostemp.m4: New file.
* m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Initialize GNULIB_MKOSTEMP,
HAVE_MKOSTEMP.
* modules/stdlib (Makefile.am): Substitute GNULIB_MKOSTEMP,
HAVE_MKOSTEMP.
* modules/mkostemp: New file, based on modules/mkstemp.
* doc/glibc-functions/mkostemp.texi: Mention the new module.
* NEWS: Mention the change.
2009-08-23 Bruno Haible
* lib/pipe2.c (pipe2): Support O_TEXT, O_BINARY on all platforms.
Reported by Eric Blake.
2009-08-23 Bruno Haible
* lib/pipe2.c (pipe2): Fix test of fcntl's return value.
Reported by Eric Blake.
2009-08-23 Bruno Haible
* modules/fchdir (Depends-on): Use fcntl-h instead of fcntl.
* modules/pipe2 (Depends-on): Likewise.
2009-08-23 Eric Blake
fcntl-h: add O_TTY_INIT support
* lib/fcntl.in.h (O_TTY_INIT): Support another POSIX macro.
* tests/test-fcntl-h.c (o): Test it.
* doc/posix-headers/fcntl.texi (fcntl.h): Update documentation.
fcntl-h: rename from fcntl, in preparation for fcntl(2)
* modules/fcntl: Move header replacement...
* modules/fcntl-h: ...to new name, so as not to collide with
like-named function.
* tests/test-fcntl.c: Rename...
* tests/test-fcntl-h.c: ...to this. Test FD_CLOEXEC.
* modules/fcntl-tests: Rename...
* modules/fcntl-h-tests: ...to this. Update test file name.
* modules/chdir-long (Depends-on): Update clients.
* modules/chdir-safer (Depends-on): Likewise.
* modules/fcntl-safer (Depends-on): Likewise.
* modules/fts (Depends-on): Likewise.
* modules/mkancesdirs (Depends-on): Likewise.
* modules/mkdir-p (Depends-on): Likewise.
* modules/open (Depends-on): Likewise.
* modules/savewd (Depends-on): Likewise.
* MODULES.html.sh (systems lacking POSIX:2008): Update name.
* doc/posix-headers/fcntl.texi (fcntl.h): Update documentation.
2009-08-22 Bruno Haible
* modules/binary-io (License): Relicense under LGPL.
* modules/pipe2 (License): Likewise.
2009-08-22 Bruno Haible
* lib/pipe-filter-ii.c (pipe_filter_ii_execute): Fix test of fcntl's
return value.
* lib/pipe-filter-gi.c (filter_init): Likewise.
Reported by Eric Blake.
2009-08-22 Bruno Haible
* lib/pipe.c (create_pipe): Use pipe2 instead of _pipe.
* modules/pipe (Depends-on): Add pipe2.
2009-08-22 Bruno Haible
Tests for module 'pipe2'.
* modules/pipe2-tests: New file.
* tests/test-pipe2.c: New file.
New module 'pipe2'.
* lib/unistd.in.h (pipe2): New declaration.
* lib/pipe2.c: New file.
* m4/pipe2.m4: New file.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize GNULIB_PIPE2 and
HAVE_PIPE2.
* modules/unistd (Makefile.am): Substitute GNULIB_PIPE2 and HAVE_PIPE2.
* modules/pipe2: New file.
* doc/glibc-functions/pipe2.texi: Mention the new module.
2009-08-22 Bruno Haible
Reference some new glibc functions.
* doc/glibc-functions/accept4.texi: New file.
* doc/glibc-functions/dup3.texi: New file.
* doc/glibc-functions/mkostemp.texi: New file.
* doc/glibc-functions/pipe2.texi: New file.
* doc/gnulib.texi (Glibc stdlib.h): Refer to mkostemp.
(Glibc sys/socket.h): Refer to accept4.
(Glibc unistd.h): Refer to dup3, pipe2.
Reported by Eric Blake.
2009-08-22 Jim Meyering
Bruno Haible
annotate automake snippets with $(AM_V_GEN) and $(AM_V_at)
This makes it so packages using automake-1.11's silent-rules option
can print e.g., a single "GEN configmake.h" line, rather than
the 30+ statements that perform the job. If you want to see the
actual commands, you can still run "make V=1".
* modules/alloca-opt: Add $(AM_V_GEN) and $(AM_V_at) prefixes
so that make output is abbreviated when those variables are defined
appropriately.
* modules/argz: Likewise.
* modules/arpa_inet: Likewise.
* modules/byteswap: Likewise.
* modules/configmake: Likewise.
* modules/dirent: Likewise.
* modules/errno: Likewise.
* modules/fcntl: Likewise.
* modules/float: Likewise.
* modules/fnmatch: Likewise.
* modules/getopt-posix: Likewise.
* modules/glob: Likewise.
* modules/iconv_open: Likewise.
* modules/inttypes: Likewise.
* modules/localcharset: Likewise.
* modules/locale: Likewise.
* modules/math: Likewise.
* modules/netdb: Likewise.
* modules/netinet_in: Likewise.
* modules/poll: Likewise.
* modules/posix_spawnp-tests: Likewise.
* modules/sched: Likewise.
* modules/search: Likewise.
* modules/selinux-h: Likewise.
* modules/signal: Likewise.
* modules/spawn: Likewise.
* modules/stdarg: Likewise.
* modules/stdbool: Likewise.
* modules/stddef: Likewise.
* modules/stdint: Likewise.
* modules/stdio: Likewise.
* modules/stdlib: Likewise.
* modules/string: Likewise.
* modules/strings: Likewise.
* modules/sys_file: Likewise.
* modules/sys_ioctl: Likewise.
* modules/sys_select: Likewise.
* modules/sys_socket: Likewise.
* modules/sys_stat: Likewise.
* modules/sys_time: Likewise.
* modules/sys_times: Likewise.
* modules/sys_utsname: Likewise.
* modules/sys_wait: Likewise.
* modules/sysexits: Likewise.
* modules/time: Likewise.
* modules/unistd: Likewise.
* modules/wchar: Likewise.
* modules/wctype: Likewise.
2009-08-22 Jim Meyering
announce-gen: detect write failure
* build-aux/announce-gen: Add Coda at end.
Remove equivalent-but-more-verbose block at top.
2009-08-19 Akim Demaille
bootstrap: --help to stdout.
* bootstrap (usage): Don't send --help to stderr.
Use a here doc instead of a long string.
2009-08-21 Eric Blake
test-popen-safer: split from test-popen
* tests/test-popen.c (main): Move...
* tests/test-popen.h: ...into new file.
* tests/test-popen-safer2.c: New file.
* modules/popen-tests (Files): Add test-popen.h.
* modules/popen-safer-tests (Files): Add test-popen-safer2.c.
Suggested by Bruno Haible.
test-fcntl-safer: split from test-open
* tests/test-open.c (main): Move...
* tests/test-open.h: ...into new file.
* tests/test-fcntl-safer.c: New file.
* modules/open-tests (Files): Add test-open.h.
* modules/fcntl-safer-tests: New file.
Suggested by Bruno Haible.
test-fopen-safer: split from test-fopen
* tests/test-fopen.c (main): Move...
* tests/test-fopen.h: ...into new file.
* tests/test-fopen-safer.c: New file.
* modules/fopen-tests (Files): Add test-fopen.h.
* modules/fopen-safer-tests: New file.
Suggested by Bruno Haible.
2009-08-21 Paolo Bonzini
popen-safer: test O_CLOEXEC at run-time.
* lib/popen-safer.c: Test O_CLOEXEC at run-time.
2009-08-21 Paolo Bonzini
fcntl: move more flags to the header
* lib/cloexec.c: Do not define FD_CLOEXEC here.
* lib/popen-safer.c: Do not alias O_NOINHERIT to O_CLOEXEC here.
* lib/fcntl.in.h: Do both things here.
2009-08-21 Jim Meyering
consistently remove $@-t before redirecting to it
* modules/argz: Remove $@-t and $@ before redirecting to the former.
* modules/alloca-opt: Likewise.
* modules/byteswap: Likewise.
* modules/fnmatch: Likewise.
* modules/getopt-posix: Likewise.
* modules/glob: Likewise.
* modules/poll: Likewise.
* modules/posix_spawnp-tests: Likewise.
* modules/sys_socket: Likewise.
* modules/sysexits: Likewise.
2009-08-21 Eric Blake
popen: simplify access to original popen
* lib/popen.c (rpl_popen): No need to worry about popen being a
macro.
Reported by Bruno Haible.
2009-08-20 Eric Blake
build: avoid some compiler warnings
* lib/selinux-at.h: Use dir_fd, not dirfd, to avoid shadowing.
* lib/exclude.c (fnmatch_pattern_has_wildcards): Use correct
type.
(new_exclude_segment, excluded_file_pattern_p)
(excluded_file_name_p): Reduce scope.
* lib/vasnprintf.c (decimal_point_char): Avoid warning on
old-style declaration.
2009-08-20 Simon Josefsson
* tests/test-exclude1.sh: Handle Windows EOL.
* tests/test-exclude2.sh: Likewise.
* tests/test-exclude3.sh: Likewise.
* tests/test-exclude4.sh: Likewise.
* tests/test-exclude5.sh: Likewise.
* tests/test-exclude6.sh: Likewise.
* tests/test-exclude7.sh: Likewise.
2009-08-19 Akim Demaille
bootstrap: find sha1sum when named gsha1sum.
* bootstrap (find_tool): New.
($SHA1SUM): New.
Use it.
2009-08-20 Jim Meyering
maint.mk: _header_without_use: fix a quoting bug and remove a bash'ism
* top/maint.mk (_header_without_use): Use "\\\\", not "\\" in the sed
expression that converts "." in a file name to "\." in the resulting
regexp. Start with a dummy statement, so that prior shell variable
definitions are expanded portably. Reported by Simon Josefsson.
2009-08-20 Paolo Bonzini
Fix polling for writeability of a screen buffer.
* lib/poll.c: Distinguish input and screen buffers for the
Win32 implementation.
* lib/select.c: Likewise.
2009-08-19 Eric Blake
popen-safer: prevent popen from clobbering std descriptors
* modules/popen-safer: New file.
* lib/popen-safer.c: Likewise.
* m4/stdio-safer.m4 (gl_POPEN_SAFER): New macro.
* lib/stdio--.h (popen): Provide override.
* lib/stdio-safer.h (popen_safer): Provide declaration.
* tests/test-popen.c (includes): Partially test this.
* modules/popen-safer-tests: New file, for more tests.
* tests/test-popen-safer.c: Likewise.
* MODULES.html.sh (file stream based Input/Output): Mention it.
tests: test some of the *-safer modules
* modules/fopen-safer (Depends-on): Add fopen.
* modules/fcntl-safer (Depends-on): Add fcntl.
* modules/stdlib-safer (Depends-on): Add stdlib.
(configure.ac): Set indicator.
* modules/unistd-safer (configure.ac): Likewise.
* modules/tmpfile-safer (configure.ac): Likewise.
(Depends-on): Add tmpfile.
* lib/stdio--.h (fopen, tmpfile): Don't override unless module is
active.
* tests/test-fopen.c (includes): Test safer versions when they are
in use.
* tests/test-open.c (includes): Likewise.
popen: fix cygwin 1.5 bug when stdin closed
* doc/posix-functions/popen.texi (popen): Document cygwin bugs.
* modules/popen: New file.
* modules/popen-tests: Likewise.
* tests/test-popen.c: Likewise.
* m4/popen.m4: Likewise.
* lib/popen.c: Likewise.
* lib/stdio.in.h (popen): New declaration.
* m4/stdio_h.m4 (gl_STDIO_H_DEFAULTS): Add popen.
* modules/stdio (Makefile.am): Likewise.
* MODULES.html.sh (systems lacking POSIX:2008): Mention it.
2009-08-17 Joel E. Denny
maint.mk: give full control over update-copyright exclusions
* top/maint.mk (VC_LIST_EXCEPT): Instead of ChangeLog, use
${VC_LIST_EXCEPT_DEFAULT-ChangeLog} as the default exclusion.
(update-copyright): Don't force inclusion of top-level
ChangeLog. Don't force exclusion of all COPYING files, but make
them the default exclusion instead.
2009-08-16 Bruno Haible
Fix test failures on Solaris 10.
* tests/uniconv/test-u8-conv-from-enc.c (main): Disable autodetect_jp
tests when Solaris iconv() is used.
* tests/uniconv/test-u16-conv-from-enc.c (main): Likewise.
* tests/uniconv/test-u32-conv-from-enc.c (main): Likewise.
* tests/uniconv/test-u8-strconv-from-enc.c (main): Likewise.
* tests/uniconv/test-u16-strconv-from-enc.c (main): Likewise.
* tests/uniconv/test-u32-strconv-from-enc.c (main): Likewise.
2009-08-16 Bruno Haible
Fix test failures on Solaris 10.
* tests/test-pipe-filter-ii1.sh: Determine the filename of a working
'tr' program and pass it as first argument.
* tests/test-pipe-filter-gi1.sh: Likewise.
* tests/test-pipe-filter-ii1.c (main): Except the filename of a 'tr'
program as first argument.
* tests/test-pipe-filter-gi1.c (main): Likewise.
2009-08-16 Eric Blake
fpurge: fix previous commits
* modules/fpurge (Makefile.am): Make replacement conditional,
partially reverting 2007-04-29 change; missed in previous
attempt.
* m4/fpurge.m4 (gl_FUNC_FPURGE): Also compile fpurge.c when fpurge
is missing.
2009-08-16 Bruno Haible
Clarify fpurge's effect on the file position.
* lib/stdio.in.h (fpurge): Specify the file position after fpurge.
* tests/test-fpurge.c (main): Make a second pass for checking the file
position.
2009-08-16 Bruno Haible
* m4/fpurge.m4 (gl_FUNC_FPURGE): Don't compile fpurge.c if only the
declaration of fpurge is missing.
* tests/test-fpurge.c (main): Check that the file has not more contents
than expected. Close the file before removing it.
2009-08-15 Eric Blake
fpurge: don't wrap working cygwin implementation
* lib/fpurge.c (fpurge): Fix comment typo.
* m4/fpurge.m4 (gl_FUNC_FPURGE): Detect BSD bug, allowing cygwin
1.7 to avoid replacement.
* tests/test-fpurge.c (main): Enhance test.
2009-08-15 Eric Blake
and Jim Meyering
test-update-copyright: skip if perl is insufficient
* tests/test-update-copyright.sh: Failure to run maintainer tool
should not cause testsuite failure on cygwin 1.5.
2009-08-14 Eric Blake
doc: mention more functions added in cygwin 1.7.0
* doc/posix-headers/limits.texi (limits.h): Update for recent
cygwin additions.
* doc/posix-headers/wordexp.texi (wordexp.h): Likewise.
* doc/posix-functions/wordexp.texi (wordexp): Likewise.
* doc/posix-functions/wordfree.texi (wordfree): Likewise.
* doc/posix-functions/setlocale.texi (setlocale): Likewise.
* doc/posix-functions/nl_langinfo.texi (nl_langinfo): Likewise.
2009-08-14 Eric Blake
maint.mk: simplify update-copyright rule
* top/maint.mk (update-copyright-local): Delete, and document how
to do it in cfg.mk instead.
(update-copyright-exclude-regexp): Delete, and document how to do
it in .x-update-copyright instead.
(update-copyright): Simplify, thanks to VC_LIST_EXCEPT. Don't
exclude ChangeLog.
2009-08-14 Bruno Haible
* m4/wchar.m4 (gl_WCHAR_H): Undo invalid optimization in last commit.
2009-08-14 Joel E. Denny
maint.mk: support update-copyright-env
* top/maint.mk (update-copyright-env): Define place-holder.
(update-copyright): Expand $(update-copyright-env) before
invoking update-copyright.
2009-08-14 Joel E. Denny
update-copyright: implement forced reformatting
* build-aux/update-copyright: Implement and document
UPDATE_COPYRIGHT_FORCE.
* tests/test-update-copyright.sh: Test it.
2009-08-14 Eric Blake