changeset 16033:917610de47d7

New modules 'at-internal', 'openat-h', split off from module 'openat'. * m4/openat.m4 (gl_FUNC_OPENAT): Don't set GNULIB_OPENAT. Don't invoke gl_PREREQ_OPENAT and gl_MODULE_INDICATOR. * modules/openat (Description): Add reference to POSIX function. (Files): Remove lib/openat.h, lib/openat-proc.c. (Depends-on): Add at-internal, openat-h. Remove fdopendir, gettext-h, intprops, unistd. (configure.ac): Remove AC_LIBOBJ of openat-proc. Invoke gl_PREREQ_OPENAT, gl_MODULE_INDICATOR here. Invoke gl_FCNTL_MODULE_INDICATOR. (Include): Remove unistd.h, openat.h. * modules/areadlinkat (Files): Add lib/at-func.c. (Depends-on): Add at-internal, dosname, errno, extensions, fchdir, openat-die, openat-h, save-cwd. * modules/areadlinkat-with-size (Files): Add lib/at-func.c. (Depends-on): Add at-internal, dosname, errno, extensions, fchdir, openat-die, openat-h, save-cwd, unistd. * modules/faccessat (Files): Add lib/at-func.c, lib/openat-priv.h. (Depends-on): Add at-internal, dosname, errno, fchdir, openat-die, openat-h, save-cwd. Remove fcntl-h, openat. * modules/fchmodat (Files): Remove lib/openat.h. (Depends-on): Add at-internal, openat-h. Remove dirent, fcntl-h, openat, stdbool, unistd. * modules/fchownat (Files): Remove lib/openat.h. (Depends-on): Add at-internal, openat-h. Remove dirent, fcntl-h, openat, stdbool, sys_stat. * modules/fdopendir (Files): Remove lib/openat-priv.h, lib/openat-proc.c. (Depends-on): Add at-internal. (condigure.ac): Remove AC_LIBOBJ of openat-proc. * modules/fstatat (Files): Remove lib/openat.h. (Depends-on): Add at-internal, openat-h. Remove dirent, openat, stdbool, unistd. * modules/fts (Depends-on): Add openat-h. * modules/linkat (Depends-on): Add at-internal, openat-h. Remove openat. * modules/mkdirat (Files): Remove lib/openat.h. (Depends-on): Add at-internal, openat-h. Remove dirent, fcntl-h, openat, stdbool, sys_stat. * modules/mkfifoat (Files): Add lib/at-func.c. (Depends-on): Add at-internal, dosname, errno, fchdir, openat-die, openat-h, save-cwd. Remove fcntl-h, openat. * modules/openat-die (Depends-on): Add openat-h. Remove openat. * modules/readlinkat (Files): Add lib/at-func.c. (Depends-on): Add at-internal, dosname, errno, fchdir, openat-die, openat-h, save-cwd. Remove fcntl-h, openat. * modules/renameat (Depends-on): Add at-internal, openat-h. Remove openat. * modules/selinux-at (Files): Add lib/at-func.c. (Depends-on): Add at-internal, dosname, errno, extensions, fchdir, fcntl-h, openat-die, openat-h, save-cwd, unistd. Remove openat. * modules/symlinkat (Files): Add lib/at-func.c. (Depends-on): Add at-internal, dosname, errno, fchdir, openat-die, openat-h, save-cwd. Remove fcntl-h, openat. * modules/unlinkat (Files): Remove lib/openat.h. (Depends-on): Add at-internal, openat-h. Remove dirent, openat, stdbool. * modules/utimensat (Files): Add lib/at-func.c. (Depends-on): Add at-internal, dosname, errno, fchdir, fcntl-h, openat-die, openat-h, save-cwd. * modules/fchownat-tests (Depends-on): Add openat-h. Remove openat. * modules/fdutimensat-tests (Depends-on): Add openat. * modules/fstatat-tests (Depends-on): Add openat-h. * modules/readlinkat-tests (Depends-on): Add openat. * modules/symlinkat-tests (Depends-on): Add openat.
author Bruno Haible <bruno@clisp.org>
date Sat, 05 Nov 2011 11:35:57 +0100
parents 2c7d38fed72d
children 3e9ac47be013
files ChangeLog m4/openat.m4 modules/areadlinkat modules/areadlinkat-with-size modules/faccessat modules/fchmodat modules/fchownat modules/fchownat-tests modules/fdopendir modules/fdutimensat-tests modules/fstatat modules/fstatat-tests modules/fts modules/linkat modules/mkdirat modules/mkfifoat modules/openat modules/openat-die modules/readlinkat modules/readlinkat-tests modules/renameat modules/selinux-at modules/symlinkat modules/symlinkat-tests modules/unlinkat modules/utimensat
diffstat 26 files changed, 178 insertions(+), 69 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,71 @@
+2011-11-05  Bruno Haible  <bruno@clisp.org>
+
+	New modules 'at-internal', 'openat-h', split off from module 'openat'.
+	* m4/openat.m4 (gl_FUNC_OPENAT): Don't set GNULIB_OPENAT. Don't
+	invoke gl_PREREQ_OPENAT and gl_MODULE_INDICATOR.
+	* modules/openat (Description): Add reference to POSIX function.
+	(Files): Remove lib/openat.h, lib/openat-proc.c.
+	(Depends-on): Add at-internal, openat-h. Remove fdopendir, gettext-h,
+	intprops, unistd.
+	(configure.ac): Remove AC_LIBOBJ of openat-proc. Invoke
+	gl_PREREQ_OPENAT, gl_MODULE_INDICATOR here. Invoke
+	gl_FCNTL_MODULE_INDICATOR.
+	(Include): Remove unistd.h, openat.h.
+	* modules/areadlinkat (Files): Add lib/at-func.c.
+	(Depends-on): Add at-internal, dosname, errno, extensions, fchdir,
+	openat-die, openat-h, save-cwd.
+	* modules/areadlinkat-with-size (Files): Add lib/at-func.c.
+	(Depends-on): Add at-internal, dosname, errno, extensions, fchdir,
+	openat-die, openat-h, save-cwd, unistd.
+	* modules/faccessat (Files): Add lib/at-func.c, lib/openat-priv.h.
+	(Depends-on): Add at-internal, dosname, errno, fchdir, openat-die,
+	openat-h, save-cwd. Remove fcntl-h, openat.
+	* modules/fchmodat (Files): Remove lib/openat.h.
+	(Depends-on): Add at-internal, openat-h. Remove dirent, fcntl-h,
+	openat, stdbool, unistd.
+	* modules/fchownat (Files): Remove lib/openat.h.
+	(Depends-on): Add at-internal, openat-h. Remove dirent, fcntl-h,
+	openat, stdbool, sys_stat.
+	* modules/fdopendir (Files): Remove lib/openat-priv.h,
+	lib/openat-proc.c.
+	(Depends-on): Add at-internal.
+	(condigure.ac): Remove AC_LIBOBJ of openat-proc.
+	* modules/fstatat (Files): Remove lib/openat.h.
+	(Depends-on): Add at-internal, openat-h. Remove dirent, openat,
+	stdbool, unistd.
+	* modules/fts (Depends-on): Add openat-h.
+	* modules/linkat (Depends-on): Add at-internal, openat-h. Remove
+	openat.
+	* modules/mkdirat (Files): Remove lib/openat.h.
+	(Depends-on): Add at-internal, openat-h. Remove dirent, fcntl-h,
+	openat, stdbool, sys_stat.
+	* modules/mkfifoat (Files): Add lib/at-func.c.
+	(Depends-on): Add at-internal, dosname, errno, fchdir, openat-die,
+	openat-h, save-cwd. Remove fcntl-h, openat.
+	* modules/openat-die (Depends-on): Add openat-h. Remove openat.
+	* modules/readlinkat (Files): Add lib/at-func.c.
+	(Depends-on): Add at-internal, dosname, errno, fchdir, openat-die,
+	openat-h, save-cwd. Remove fcntl-h, openat.
+	* modules/renameat (Depends-on): Add at-internal, openat-h. Remove
+	openat.
+	* modules/selinux-at (Files): Add lib/at-func.c.
+	(Depends-on): Add at-internal, dosname, errno, extensions, fchdir,
+	fcntl-h, openat-die, openat-h, save-cwd, unistd. Remove openat.
+	* modules/symlinkat (Files): Add lib/at-func.c.
+	(Depends-on): Add at-internal, dosname, errno, fchdir, openat-die,
+	openat-h, save-cwd. Remove fcntl-h, openat.
+	* modules/unlinkat (Files): Remove lib/openat.h.
+	(Depends-on): Add at-internal, openat-h. Remove dirent, openat,
+	stdbool.
+	* modules/utimensat (Files): Add lib/at-func.c.
+	(Depends-on): Add at-internal, dosname, errno, fchdir, fcntl-h,
+	openat-die, openat-h, save-cwd.
+	* modules/fchownat-tests (Depends-on): Add openat-h. Remove openat.
+	* modules/fdutimensat-tests (Depends-on): Add openat.
+	* modules/fstatat-tests (Depends-on): Add openat-h.
+	* modules/readlinkat-tests (Depends-on): Add openat.
+	* modules/symlinkat-tests (Depends-on): Add openat.
+
 2011-11-05  Bruno Haible  <bruno@clisp.org>
 
 	openat: Include <stdbool.h>.
--- a/m4/openat.m4
+++ b/m4/openat.m4
@@ -1,4 +1,4 @@
-# serial 42
+# serial 43
 # See if we need to use our replacement for Solaris' openat et al functions.
 
 dnl Copyright (C) 2004-2011 Free Software Foundation, Inc.
@@ -11,8 +11,6 @@
 AC_DEFUN([gl_FUNC_OPENAT],
 [
   AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
-  GNULIB_OPENAT=1
-
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
   AC_CHECK_FUNCS_ONCE([openat])
   AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
@@ -26,13 +24,11 @@
     ;;
   *)
     HAVE_OPENAT=0
-    gl_PREREQ_OPENAT;;
+    ;;
   esac
-
-  dnl This is tested at least via getcwd.c.
-  gl_MODULE_INDICATOR([openat])
 ])
 
+# Prerequisites of lib/openat.c.
 AC_DEFUN([gl_PREREQ_OPENAT],
 [
   AC_REQUIRE([AC_C_INLINE])
--- a/modules/areadlinkat
+++ b/modules/areadlinkat
@@ -4,11 +4,20 @@
 Files:
 lib/areadlink.h
 lib/areadlinkat.c
+lib/at-func.c
 
 Depends-on:
 areadlink
 careadlinkat
 readlinkat
+at-internal
+dosname
+errno
+extensions
+fchdir
+openat-die
+openat-h
+save-cwd
 
 configure.ac:
 gl_MODULE_INDICATOR([areadlinkat])
--- a/modules/areadlinkat-with-size
+++ b/modules/areadlinkat-with-size
@@ -4,11 +4,21 @@
 Files:
 lib/areadlink.h
 lib/areadlinkat-with-size.c
+lib/at-func.c
 
 Depends-on:
 areadlink-with-size
 stdint
 readlinkat
+at-internal
+dosname
+errno
+extensions
+fchdir
+openat-die
+openat-h
+save-cwd
+unistd
 
 configure.ac:
 gl_MODULE_INDICATOR([areadlinkat-with-size])
--- a/modules/faccessat
+++ b/modules/faccessat
@@ -3,14 +3,21 @@
 
 Files:
 lib/faccessat.c
+lib/at-func.c
+lib/openat-priv.h
 m4/faccessat.m4
 
 Depends-on:
-unistd
+at-internal
+dosname
+errno
 extensions
-fcntl-h
+fchdir
+openat-die
+openat-h
+save-cwd
+unistd
 euidaccess      [test $HAVE_FACCESSAT = 0]
-openat          [test $HAVE_FACCESSAT = 0]
 
 configure.ac:
 gl_FUNC_FACCESSAT
--- a/modules/fchmodat
+++ b/modules/fchmodat
@@ -4,23 +4,19 @@
 Files:
 lib/fchmodat.c
 lib/at-func.c
-lib/openat.h
 lib/openat-priv.h
 m4/fchmodat.m4
 
 Depends-on:
-dirent
+at-internal
 dosname
 errno
 extensions
 fchdir
-fcntl-h
-openat
 openat-die
+openat-h
 save-cwd
-stdbool
 sys_stat
-unistd
 
 configure.ac:
 gl_FUNC_FCHMODAT
--- a/modules/fchownat
+++ b/modules/fchownat
@@ -4,24 +4,20 @@
 Files:
 lib/fchownat.c
 lib/at-func.c
-lib/openat.h
 lib/openat-priv.h
 m4/fchownat.m4
 
 Depends-on:
-dirent
+at-internal
 dosname
 errno
 extensions
 fchdir
-fcntl-h
 fstatat
 lchown          [test $HAVE_FCHOWNAT = 0 || test $REPLACE_FCHOWNAT = 1]
-openat
 openat-die
+openat-h
 save-cwd
-stdbool
-sys_stat
 unistd
 
 configure.ac:
--- a/modules/fchownat-tests
+++ b/modules/fchownat-tests
@@ -9,7 +9,7 @@
 Depends-on:
 ignore-value
 mgetgroups
-openat
+openat-h
 progname
 usleep
 stat-time
--- a/modules/fdopendir
+++ b/modules/fdopendir
@@ -3,13 +3,12 @@
 
 Files:
 lib/fdopendir.c
-lib/openat-priv.h
-lib/openat-proc.c
 m4/fdopendir.m4
 
 Depends-on:
 dirent
 extensions
+at-internal     [test $HAVE_FDOPENDIR = 0]
 dup             [test $HAVE_FDOPENDIR = 0]
 errno           [test $HAVE_FDOPENDIR = 0]
 fchdir          [test $HAVE_FDOPENDIR = 0]
@@ -23,9 +22,6 @@
 if test $HAVE_FDOPENDIR = 0 || test $REPLACE_FDOPENDIR = 1; then
   AC_LIBOBJ([fdopendir])
 fi
-if test $HAVE_FDOPENDIR = 0; then
-  AC_LIBOBJ([openat-proc])
-fi
 gl_DIRENT_MODULE_INDICATOR([fdopendir])
 gl_MODULE_INDICATOR([fdopendir])
 
--- a/modules/fdutimensat-tests
+++ b/modules/fdutimensat-tests
@@ -9,6 +9,7 @@
 
 Depends-on:
 ignore-value
+openat
 timespec
 dup
 usleep
--- a/modules/fstatat
+++ b/modules/fstatat
@@ -4,12 +4,11 @@
 Files:
 lib/fstatat.c
 lib/at-func.c
-lib/openat.h
 lib/openat-priv.h
 m4/fstatat.m4
 
 Depends-on:
-dirent
+at-internal
 dosname
 errno
 extensions
@@ -17,12 +16,10 @@
 fcntl-h
 fstat
 lstat
-openat
 openat-die
+openat-h
 save-cwd
-stdbool
 sys_stat
-unistd
 
 configure.ac:
 gl_FUNC_FSTATAT
--- a/modules/fstatat-tests
+++ b/modules/fstatat-tests
@@ -8,6 +8,7 @@
 Depends-on:
 getcwd-lgpl
 ignore-value
+openat-h
 progname
 symlink
 
--- a/modules/fts
+++ b/modules/fts
@@ -23,6 +23,7 @@
 i-ring
 lstat
 memmove
+openat-h
 openat-safer
 opendir
 readdir
--- a/modules/linkat
+++ b/modules/linkat
@@ -11,6 +11,7 @@
 extensions
 areadlink        [test $HAVE_LINKAT = 0 || test $REPLACE_LINKAT = 1]
 areadlinkat      [test $HAVE_LINKAT = 0 || test $REPLACE_LINKAT = 1]
+at-internal      [test $HAVE_LINKAT = 0 || test $REPLACE_LINKAT = 1]
 dirname-lgpl     [test $HAVE_LINKAT = 0 || test $REPLACE_LINKAT = 1]
 dosname          [test $HAVE_LINKAT = 0 || test $REPLACE_LINKAT = 1]
 errno            [test $HAVE_LINKAT = 0 || test $REPLACE_LINKAT = 1]
@@ -19,7 +20,7 @@
 fstat            [test $HAVE_LINKAT = 0 || test $REPLACE_LINKAT = 1]
 fstatat          [test $HAVE_LINKAT = 0 || test $REPLACE_LINKAT = 1]
 getcwd-lgpl      [test $HAVE_LINKAT = 0 || test $REPLACE_LINKAT = 1]
-openat           [test $HAVE_LINKAT = 0 || test $REPLACE_LINKAT = 1]
+openat-h         [test $HAVE_LINKAT = 0 || test $REPLACE_LINKAT = 1]
 openat-die       [test $HAVE_LINKAT = 0 || test $REPLACE_LINKAT = 1]
 link             [test $HAVE_LINKAT = 0 || test $REPLACE_LINKAT = 1]
 link-follow      [test $HAVE_LINKAT = 0 || test $REPLACE_LINKAT = 1]
--- a/modules/mkdirat
+++ b/modules/mkdirat
@@ -4,23 +4,19 @@
 Files:
 lib/mkdirat.c
 lib/at-func.c
-lib/openat.h
 lib/openat-priv.h
 m4/mkdirat.m4
 
 Depends-on:
-dirent
+at-internal
 dosname
 errno
 extensions
 fchdir
-fcntl-h
 mkdir           [test $HAVE_MKDIRAT = 0]
-openat
 openat-die
+openat-h
 save-cwd
-stdbool
-sys_stat
 unistd
 
 configure.ac:
--- a/modules/mkfifoat
+++ b/modules/mkfifoat
@@ -4,15 +4,21 @@
 Files:
 lib/mkfifoat.c
 lib/mknodat.c
+lib/at-func.c
 m4/mkfifoat.m4
 
 Depends-on:
-sys_stat
+at-internal
+dosname
+errno
 extensions
-fcntl-h
+fchdir
+openat-die
+openat-h
+save-cwd
+sys_stat
 mkfifo          [test $HAVE_MKFIFOAT = 0]
 mknod           [test $HAVE_MKNODAT = 0]
-openat          [test $HAVE_MKFIFOAT = 0 || test $HAVE_MKNODAT = 0]
 
 configure.ac:
 gl_FUNC_MKFIFOAT
--- a/modules/openat
+++ b/modules/openat
@@ -1,46 +1,42 @@
 Description:
-Open a file at a directory.
+openat() function: Open a file at a directory.
 
 Files:
 lib/at-func.c
 lib/openat.c
-lib/openat.h
 lib/openat-priv.h
-lib/openat-proc.c
 m4/openat.m4
 m4/mode_t.m4
 
 Depends-on:
+at-internal
 dosname
 errno
 extensions
 fchdir
 fcntl-h
-fdopendir
 fstat
-gettext-h
-intprops
 largefile
 open
 openat-die
+openat-h
 save-cwd
 stdbool
 sys_stat
-unistd
 
 configure.ac:
 gl_FUNC_OPENAT
-AC_LIBOBJ([openat-proc])
 if test $HAVE_OPENAT = 0 || test $REPLACE_OPENAT = 1; then
   AC_LIBOBJ([openat])
+  gl_PREREQ_OPENAT
 fi
+gl_MODULE_INDICATOR([openat]) dnl for lib/getcwd.c
+gl_FCNTL_MODULE_INDICATOR([openat])
 
 Makefile.am:
 
 Include:
 <fcntl.h>
-<unistd.h>
-"openat.h"
 
 License:
 GPL
--- a/modules/openat-die
+++ b/modules/openat-die
@@ -5,10 +5,10 @@
 lib/openat-die.c
 
 Depends-on:
-openat
+openat-h
 error
+exitfail
 gettext-h
-exitfail
 
 configure.ac:
 
--- a/modules/readlinkat
+++ b/modules/readlinkat
@@ -3,13 +3,19 @@
 
 Files:
 lib/readlinkat.c
+lib/at-func.c
 m4/readlinkat.m4
 
 Depends-on:
-unistd
+at-internal
+dosname
+errno
 extensions
-fcntl-h
-openat          [test $HAVE_READLINKAT = 0]
+fchdir
+openat-die
+openat-h
+save-cwd
+unistd
 readlink        [test $HAVE_READLINKAT = 0]
 
 configure.ac:
--- a/modules/readlinkat-tests
+++ b/modules/readlinkat-tests
@@ -6,6 +6,7 @@
 
 Depends-on:
 ignore-value
+openat
 symlinkat
 unlinkat
 
--- a/modules/renameat
+++ b/modules/renameat
@@ -10,13 +10,14 @@
 stdio
 extensions
 fcntl-h
+at-internal      [test $HAVE_RENAMEAT = 0 || test $REPLACE_RENAMEAT = 1]
 dosname          [test $HAVE_RENAMEAT = 0 || test $REPLACE_RENAMEAT = 1]
 filenamecat-lgpl [test $HAVE_RENAMEAT = 0 || test $REPLACE_RENAMEAT = 1]
 fstat            [test $HAVE_RENAMEAT = 0 || test $REPLACE_RENAMEAT = 1]
 fstatat          [test $HAVE_RENAMEAT = 0 || test $REPLACE_RENAMEAT = 1]
 getcwd-lgpl      [test $HAVE_RENAMEAT = 0 || test $REPLACE_RENAMEAT = 1]
-openat           [test $HAVE_RENAMEAT = 0 || test $REPLACE_RENAMEAT = 1]
 openat-die       [test $HAVE_RENAMEAT = 0 || test $REPLACE_RENAMEAT = 1]
+openat-h         [test $HAVE_RENAMEAT = 0 || test $REPLACE_RENAMEAT = 1]
 rename           [test $HAVE_RENAMEAT = 0 || test $REPLACE_RENAMEAT = 1]
 same-inode       [test $HAVE_RENAMEAT = 0 || test $REPLACE_RENAMEAT = 1]
 save-cwd         [test $HAVE_RENAMEAT = 0 || test $REPLACE_RENAMEAT = 1]
--- a/modules/selinux-at
+++ b/modules/selinux-at
@@ -2,12 +2,22 @@
 openat-style fd-relative functions for SE Linux
 
 Files:
+lib/selinux-at.h
 lib/selinux-at.c
-lib/selinux-at.h
+lib/at-func.c
 
 Depends-on:
-openat
 selinux-h
+at-internal
+dosname
+errno
+extensions
+fchdir
+fcntl-h
+openat-die
+openat-h
+save-cwd
+unistd
 
 configure.ac:
 AC_CHECK_HEADERS([selinux/flask.h])
--- a/modules/symlinkat
+++ b/modules/symlinkat
@@ -3,13 +3,19 @@
 
 Files:
 lib/symlinkat.c
+lib/at-func.c
 m4/symlinkat.m4
 
 Depends-on:
-unistd
+at-internal
+dosname
+errno
 extensions
-fcntl-h
-openat          [test $HAVE_SYMLINKAT = 0]
+fchdir
+openat-die
+openat-h
+save-cwd
+unistd
 symlink         [test $HAVE_SYMLINKAT = 0]
 
 configure.ac:
--- a/modules/symlinkat-tests
+++ b/modules/symlinkat-tests
@@ -6,6 +6,7 @@
 
 Depends-on:
 ignore-value
+openat
 
 configure.ac:
 
--- a/modules/unlinkat
+++ b/modules/unlinkat
@@ -4,23 +4,21 @@
 Files:
 lib/unlinkat.c
 lib/at-func.c
-lib/openat.h
 lib/openat-priv.h
 m4/unlinkat.m4
 
 Depends-on:
-dirent
+at-internal
 dosname
 errno
 extensions
 fchdir
 fcntl-h
 fstatat
-openat
 openat-die
+openat-h
 rmdir           [test $HAVE_UNLINKAT = 0]
 save-cwd
-stdbool
 sys_stat
 unistd
 unlink          [test $HAVE_UNLINKAT = 0]
--- a/modules/utimensat
+++ b/modules/utimensat
@@ -3,11 +3,20 @@
 
 Files:
 lib/utimensat.c
+lib/at-func.c
 m4/utimensat.m4
 
 Depends-on:
+at-internal
+dosname
+errno
+extensions
+fchdir
+fcntl-h
+openat-die
+openat-h
+save-cwd
 sys_stat
-extensions
 fstatat         [test $HAVE_UTIMENSAT = 0 || test $REPLACE_UTIMENSAT = 1]
 utimens         [test $HAVE_UTIMENSAT = 0 || test $REPLACE_UTIMENSAT = 1]