gnulib.git
14 years agofirst run of clscan --merge
Ian Beckwith [Mon, 14 Sep 2009 03:41:11 +0000 (04:41 +0100)]
first run of clscan --merge

14 years agonew.txt: yet more tweaks
Ian Beckwith [Mon, 14 Sep 2009 03:10:08 +0000 (04:10 +0100)]
new.txt: yet more tweaks

14 years agonew.txt: more tweaks
Ian Beckwith [Sat, 12 Sep 2009 20:46:13 +0000 (21:46 +0100)]
new.txt: more tweaks

14 years agonew.txt: small fixes
Ian Beckwith [Sat, 12 Sep 2009 20:36:55 +0000 (21:36 +0100)]
new.txt: small fixes

14 years agonew.txt: finished first pass
Ian Beckwith [Sat, 12 Sep 2009 20:01:55 +0000 (21:01 +0100)]
new.txt: finished first pass

14 years agonew.txt: done to tests/unicase
Ian Beckwith [Sat, 12 Sep 2009 07:26:06 +0000 (08:26 +0100)]
new.txt: done to tests/unicase

14 years agohandle modules/ outside clscan
Ian Beckwith [Sat, 12 Sep 2009 06:48:50 +0000 (07:48 +0100)]
handle modules/ outside clscan

14 years agonew.txt: finished m4/
Ian Beckwith [Sat, 12 Sep 2009 05:50:48 +0000 (06:50 +0100)]
new.txt: finished m4/

14 years agonew.txt: finished lib/
Ian Beckwith [Fri, 11 Sep 2009 03:08:42 +0000 (04:08 +0100)]
new.txt: finished lib/

14 years agomore new.txt updates
Ian Beckwith [Thu, 10 Sep 2009 22:54:51 +0000 (23:54 +0100)]
more new.txt updates

14 years agostarted updating new.txt
Ian Beckwith [Thu, 10 Sep 2009 03:33:23 +0000 (04:33 +0100)]
started updating new.txt

14 years agos/license-text/license_text/
Ian Beckwith [Thu, 10 Sep 2009 00:37:35 +0000 (01:37 +0100)]
s/license-text/license_text/

14 years agofinished(ish) clscan, first proper --scan run
Ian Beckwith [Thu, 10 Sep 2009 00:03:48 +0000 (01:03 +0100)]
finished(ish) clscan, first proper --scan run

14 years agoCommit mostly-finished clscan, a tool to scan file copyrights and licenses
Ian Beckwith [Wed, 9 Sep 2009 17:46:03 +0000 (18:46 +0100)]
Commit mostly-finished clscan, a tool to scan file copyrights and licenses

14 years agofix test file perms debian/20090908+c5c46dc-1
Ian Beckwith [Tue, 8 Sep 2009 01:48:44 +0000 (02:48 +0100)]
fix test file perms

14 years agodebian/copyright: improved somewhat; still needs more work.
Ian Beckwith [Tue, 8 Sep 2009 01:32:20 +0000 (02:32 +0100)]
debian/copyright: improved somewhat; still needs more work.

14 years agoRegistered gnulib.html with doc-base
Ian Beckwith [Tue, 8 Sep 2009 00:55:13 +0000 (01:55 +0100)]
Registered gnulib.html with doc-base

14 years agoMerge branch 'upstream'
Ian Beckwith [Mon, 7 Sep 2009 23:17:35 +0000 (00:17 +0100)]
Merge branch 'upstream'

14 years agoAdded stub debian/watch file.
Ian Beckwith [Mon, 7 Sep 2009 22:00:37 +0000 (23:00 +0100)]
Added stub debian/watch file.

14 years agorename: modernize replacement upstream/20090908+c5c46dc
Eric Blake [Mon, 7 Sep 2009 17:27:05 +0000 (11:27 -0600)]
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.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agostdio: sort witness names
Eric Blake [Mon, 7 Sep 2009 16:16:42 +0000 (10:16 -0600)]
stdio: sort witness names

* modules/stdio (Makefile.am): Sort replacements.
* m4/stdio_h.m4 (gl_STDIO_H_DEFAULTS): Likewise.
* lib/stdio.in.h: Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agogetcwd: minor cleanups
Eric Blake [Mon, 7 Sep 2009 11:51:20 +0000 (05:51 -0600)]
getcwd: minor cleanups

* lib/getcwd.c (AT_FDCWD): Delete; rely on <fcntl.h> instead.
(is_ENAMETOOLONG): Delete; ENAMETOOLONG is portable.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agoopenat: provide more convenience names
Eric Blake [Mon, 7 Sep 2009 11:28:13 +0000 (05:28 -0600)]
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.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agodoc: fix comments in recent patches
Eric Blake [Mon, 7 Sep 2009 02:21:28 +0000 (20:21 -0600)]
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.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agoAdd clisp to Suggests: for gen-uninames.lisp. Should only be needed if you are hackin...
Ian Beckwith [Mon, 7 Sep 2009 02:56:21 +0000 (03:56 +0100)]
Add clisp to Suggests: for gen-uninames.lisp. Should only be needed if you are hacking on gnulib itself.

14 years agofaccessat, symlinkat: continue cleanup of previous patch
Eric Blake [Mon, 7 Sep 2009 02:53:59 +0000 (20:53 -0600)]
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.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agoremove .cvsignore and .gitignore files on install
Ian Beckwith [Mon, 7 Sep 2009 02:35:52 +0000 (03:35 +0100)]
remove .cvsignore and .gitignore files on install

14 years agoadded README.source
Ian Beckwith [Mon, 7 Sep 2009 02:19:46 +0000 (03:19 +0100)]
added README.source

14 years agoBump debhelper build-dep to >= 7.0.50~ (for overrides).
Ian Beckwith [Mon, 7 Sep 2009 01:06:39 +0000 (02:06 +0100)]
Bump debhelper build-dep to >= 7.0.50~ (for overrides).

14 years ago * debian/control: add Depends: ${misc:Depends}.
Ian Beckwith [Mon, 7 Sep 2009 01:04:50 +0000 (02:04 +0100)]
  * debian/control: add Depends: ${misc:Depends}.

14 years agodebian/rules upstream:
Ian Beckwith [Mon, 7 Sep 2009 00:58:21 +0000 (01:58 +0100)]
debian/rules upstream:
 + use short git hash in package version.
 + use --depth 1 to clone.

14 years agoNew Maintainer
Ian Beckwith [Mon, 7 Sep 2009 00:57:32 +0000 (01:57 +0100)]
New Maintainer

14 years agoMerge branch 'upstream'
Ian Beckwith [Sun, 6 Sep 2009 23:44:26 +0000 (00:44 +0100)]
Merge branch 'upstream'

14 years agoRemove dependency from unistd_h.m4, sys_stat_h.m4, fcntl_h.m4 to openat.m4.
Bruno Haible [Sun, 6 Sep 2009 23:33:12 +0000 (01:33 +0200)]
Remove dependency from unistd_h.m4, sys_stat_h.m4, fcntl_h.m4 to openat.m4.

14 years agoMerge branch 'upstream'
Ian Beckwith [Sun, 6 Sep 2009 23:33:11 +0000 (00:33 +0100)]
Merge branch 'upstream'

14 years agoRemove unneeded gl_MODULE_INDICATOR invocation.
Bruno Haible [Sun, 6 Sep 2009 21:23:29 +0000 (23:23 +0200)]
Remove unneeded gl_MODULE_INDICATOR invocation.

14 years agoSet errno to ENOSYS when a function is entirely unsupported.
Bruno Haible [Sun, 6 Sep 2009 20:36:55 +0000 (22:36 +0200)]
Set errno to ENOSYS when a function is entirely unsupported.

14 years agoMention affected platforms.
Bruno Haible [Sun, 6 Sep 2009 19:41:20 +0000 (21:41 +0200)]
Mention affected platforms.

14 years agoFix indentation.
Bruno Haible [Sun, 6 Sep 2009 19:41:00 +0000 (21:41 +0200)]
Fix indentation.

14 years agoMerge branch 'upstream'
Ian Beckwith [Sun, 6 Sep 2009 19:34:26 +0000 (20:34 +0100)]
Merge branch 'upstream'

14 years agoFor NULL, include <stdlib.h>, not <stdio.h>.
Bruno Haible [Sun, 6 Sep 2009 19:15:41 +0000 (21:15 +0200)]
For NULL, include <stdlib.h>, not <stdio.h>.

14 years agoWork around a glibc bug in strtok_r.
Ben Pfaff [Sun, 6 Sep 2009 15:17:41 +0000 (17:17 +0200)]
Work around a glibc bug in strtok_r.

14 years agoexclude: minor fix
Sergey Poznyakoff [Sun, 6 Sep 2009 09:01:23 +0000 (12:01 +0300)]
exclude: minor fix

* lib/exclude.c: Include wctype.h

14 years agobootstrap: improve error message
Akim Demaille [Thu, 3 Sep 2009 07:55:06 +0000 (09:55 +0200)]
bootstrap: improve error message

* build-aux/bootstrap (find_tool): Upon failure, report the list
of candidates.
Honor the initial value of the envvar.

14 years agoUpdate copyright year.
Bruno Haible [Sun, 6 Sep 2009 00:21:50 +0000 (02:21 +0200)]
Update copyright year.

14 years agoMerge branch 'upstream'
Ian Beckwith [Sat, 5 Sep 2009 20:54:40 +0000 (21:54 +0100)]
Merge branch 'upstream'

14 years agosymlinkat: new module
Eric Blake [Sat, 5 Sep 2009 17:49:15 +0000 (11:49 -0600)]
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.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agotest-openat-safer: add more checks
Eric Blake [Sat, 5 Sep 2009 12:39:17 +0000 (06:39 -0600)]
test-openat-safer: add more checks
* tests/test-openat-safer.c (main): Check more code paths.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agosyntax-check: detect unnecessary inclusion of openat.h
Jim Meyering [Sat, 5 Sep 2009 17:54:12 +0000 (19:54 +0200)]
syntax-check: detect unnecessary inclusion of openat.h

* top/maint.mk (sc_prohibit_openat_without_use): New rule.

14 years agoSupport towlower and towupper.
Bruno Haible [Sat, 5 Sep 2009 16:06:54 +0000 (18:06 +0200)]
Support towlower and towupper.

14 years agoFix bug occurring when converting invalid input.
Bruno Haible [Sat, 5 Sep 2009 14:49:46 +0000 (16:49 +0200)]
Fix bug occurring when converting invalid input.

14 years agoTest indirect conversion as well.
Bruno Haible [Sat, 5 Sep 2009 14:47:45 +0000 (16:47 +0200)]
Test indirect conversion as well.

14 years agoMerge branch 'upstream'
Ian Beckwith [Sat, 5 Sep 2009 06:01:24 +0000 (07:01 +0100)]
Merge branch 'upstream'

14 years agoimported debian/ files from gnulib 20090801-2
Ian Beckwith [Sat, 5 Sep 2009 05:48:56 +0000 (06:48 +0100)]
imported debian/ files from gnulib 20090801-2

14 years agoopenat: fail with ENOENT on empty name
Eric Blake [Sat, 5 Sep 2009 03:22:21 +0000 (21:22 -0600)]
openat: fail with ENOENT on empty name

* lib/openat-proc.c (openat_proc_name): Special-case the empty
buffer.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agolink-follow: fix logic bug in prior patch
Eric Blake [Fri, 4 Sep 2009 21:40:22 +0000 (15:40 -0600)]
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.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agolink-follow: accomodate mingw and cross-compilation
Eric Blake [Fri, 4 Sep 2009 17:49:02 +0000 (11:49 -0600)]
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.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agofaccessat: compile replacement
Eric Blake [Fri, 4 Sep 2009 04:49:58 +0000 (22:49 -0600)]
faccessat: compile replacement

* m4/faccessat.m4 (gl_FUNC_FACCESSAT): Build replacement when
needed.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agofts: fix compilation error
Eric Blake [Fri, 4 Sep 2009 04:34:10 +0000 (22:34 -0600)]
fts: fix compilation error

* lib/fts.c (includes): Re-add "openat.h", for
openat_needs_fchdir.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agofaccessat: new module
Eric Blake [Thu, 3 Sep 2009 19:41:18 +0000 (13:41 -0600)]
faccessat: new module

* modules/faccessat: New file.
* lib/faccessat.m4: 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.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agoeuidaccess: prefer POSIX over non-standard implementation
Eric Blake [Thu, 3 Sep 2009 19:43:12 +0000 (13:43 -0600)]
euidaccess: prefer POSIX over non-standard implementation

* m4/euidaccess.m4 (gl_PREREQ_EUIDACCESS): Check for faccessat.
* lib/euidaccess.c (euidaccess): Use it if available.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agoopenat: make template easier to use
Eric Blake [Thu, 3 Sep 2009 17:38:53 +0000 (11:38 -0600)]
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.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agoopenat: declare in POSIX headers
Eric Blake [Wed, 2 Sep 2009 23:14:26 +0000 (17:14 -0600)]
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.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agoerrno: use consistently
Eric Blake [Wed, 2 Sep 2009 23:06:43 +0000 (17:06 -0600)]
errno: use consistently

* lib/c-stack.c (ENOTSUP): <errno.h> 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.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agofts: avoid leaking fds
Eric Blake [Wed, 2 Sep 2009 20:44:51 +0000 (14:44 -0600)]
fts: avoid leaking fds

* modules/fts (Depends-on): Add cloexec.
* lib/fts.c (opendirat, diropen, fts_build): Set close-on-exec
flag.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agofts: make directory fds more robust
Eric Blake [Tue, 1 Sep 2009 20:06:37 +0000 (14:06 -0600)]
fts: make directory fds more robust

* lib/fts.c (O_DIRECTORY): Let <fcntl.h> take care of this.
(opendirat): Specify O_DIRECTORY, and add fallbacks for safety.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agobackupfile, chdir-long, fts, savedir: make safer
Eric Blake [Tue, 1 Sep 2009 18:25:01 +0000 (12:25 -0600)]
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.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agoopenat-safer: new module
Eric Blake [Wed, 2 Sep 2009 12:07:54 +0000 (06:07 -0600)]
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.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agodirent-safer: new module
Eric Blake [Tue, 1 Sep 2009 13:41:28 +0000 (07:41 -0600)]
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.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agofdopendir: optimize on mingw
Eric Blake [Tue, 1 Sep 2009 16:05:44 +0000 (10:05 -0600)]
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().

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agofdopendir: split into its own module
Eric Blake [Tue, 1 Sep 2009 02:37:59 +0000 (20:37 -0600)]
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 <dirent.h>, 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.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agofchdir: use more consistent macro convention
Eric Blake [Tue, 1 Sep 2009 15:18:16 +0000 (09:18 -0600)]
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.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agofchdir: simplify error handling, and support dup3
Eric Blake [Mon, 31 Aug 2009 20:20:03 +0000 (14:20 -0600)]
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.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agoReplace uses of obsolete Autoconf macros with modern counterparts.
Ralf Wildenhues [Wed, 2 Sep 2009 22:10:41 +0000 (00:10 +0200)]
Replace uses of obsolete Autoconf macros with modern counterparts.

14 years agoRelicense mkdtemp under LGPLv2+.
Bruno Haible [Wed, 2 Sep 2009 20:43:05 +0000 (22:43 +0200)]
Relicense mkdtemp under LGPLv2+.

14 years agoReplace uses of obsolete autoconf macros in Jim's modules.
Ralf Wildenhues [Wed, 2 Sep 2009 18:07:33 +0000 (20:07 +0200)]
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.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14 years agofchdir: fix off-by-one bug in previous patch
Eric Blake [Tue, 1 Sep 2009 16:06:44 +0000 (10:06 -0600)]
fchdir: fix off-by-one bug in previous patch

* lib/fchdir.c (rpl_fstat): Use correct bounds.
(_gl_unregister_fd): Delete useless if.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agomaint.mk: sort the list of syntax-check rules
Daniel P. Berrange [Tue, 1 Sep 2009 14:39:43 +0000 (16:39 +0200)]
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.

14 years agoUse $(MKDIR_P) instead of @MKDIR_P@.
Simon Josefsson [Tue, 1 Sep 2009 12:25:07 +0000 (14:25 +0200)]
Use $(MKDIR_P) instead of @MKDIR_P@.

14 years agofts: help ensure that return values are not ignored
Jim Meyering [Tue, 1 Sep 2009 09:20:41 +0000 (11:20 +0200)]
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__.

14 years agofts: fts_close now fails also when closing a dir file descriptor fails
Jim Meyering [Tue, 1 Sep 2009 09:18:07 +0000 (11:18 +0200)]
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.

14 years agoannounce-gen: correct formatting in --help output
Jim Meyering [Tue, 1 Sep 2009 06:49:27 +0000 (08:49 +0200)]
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:.

14 years agofchdir: port to mingw
Eric Blake [Mon, 31 Aug 2009 12:09:08 +0000 (06:09 -0600)]
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.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agocanonicalize: allow cross-testing from cygwin to mingw
Eric Blake [Mon, 31 Aug 2009 15:12:30 +0000 (09:12 -0600)]
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.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agochown: avoid compilation warning on mingw
Eric Blake [Mon, 31 Aug 2009 15:00:45 +0000 (09:00 -0600)]
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.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agoFix test whether $CONFIG_SHELL has a working 'echo' command.
Stefano Lattarini [Mon, 31 Aug 2009 21:01:55 +0000 (23:01 +0200)]
Fix test whether $CONFIG_SHELL has a working 'echo' command.

14 years agocanonicalize: remove useless initialization
Jim Meyering [Mon, 31 Aug 2009 14:32:40 +0000 (16:32 +0200)]
canonicalize: remove useless initialization

* lib/canonicalize.c (canonicalize_filename_mode): Remove useless
initialization of local, "end".

14 years agoFix an unnecessary error on Solaris 10 on NFSv3 file systems.
Bruno Haible [Sun, 30 Aug 2009 22:53:46 +0000 (00:53 +0200)]
Fix an unnecessary error on Solaris 10 on NFSv3 file systems.

14 years agoUse /usr/xpg6/bin/tr when it exists.
Bruno Haible [Sun, 30 Aug 2009 21:43:52 +0000 (23:43 +0200)]
Use /usr/xpg6/bin/tr when it exists.

14 years agoFix today's commit.
Bruno Haible [Sun, 30 Aug 2009 16:19:49 +0000 (18:19 +0200)]
Fix today's commit.

14 years agoWork around deficient /usr/bin/id program on Solaris.
Bruno Haible [Sun, 30 Aug 2009 15:36:32 +0000 (17:36 +0200)]
Work around deficient /usr/bin/id program on Solaris.

14 years agoNew module 'xstriconveh'.
Bruno Haible [Sun, 30 Aug 2009 14:27:11 +0000 (16:27 +0200)]
New module 'xstriconveh'.

14 years agoMake the striconveh API easier to use.
Bruno Haible [Sun, 30 Aug 2009 14:24:51 +0000 (16:24 +0200)]
Make the striconveh API easier to use.

14 years agoMention indirect conversion problem.
Bruno Haible [Sun, 30 Aug 2009 14:24:02 +0000 (16:24 +0200)]
Mention indirect conversion problem.

14 years agoWork around iconv_open problem on Solaris.
Bruno Haible [Sun, 30 Aug 2009 12:29:34 +0000 (14:29 +0200)]
Work around iconv_open problem on Solaris.

14 years agomaint.mk: remove more coreutils-specific targets; XZ_OPT=-9ev
Jim Meyering [Sat, 29 Aug 2009 15:24:03 +0000 (17:24 +0200)]
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 "-".

14 years ago-m(dup2): Texinfo typo
Karl Berry [Thu, 27 Aug 2009 23:21:38 +0000 (16:21 -0700)]
-m(dup2): Texinfo typo

14 years agoRemove test that is outside the specification.
Bruno Haible [Thu, 27 Aug 2009 21:31:13 +0000 (23:31 +0200)]
Remove test that is outside the specification.

14 years agoAvoid sizeof __func__ == 0 pitfall.
Bruno Haible [Thu, 27 Aug 2009 21:30:11 +0000 (23:30 +0200)]
Avoid sizeof __func__ == 0 pitfall.

14 years agoFix link error on Solaris.
Bruno Haible [Thu, 27 Aug 2009 07:08:17 +0000 (09:08 +0200)]
Fix link error on Solaris.