summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2011-11-04 11:31:25 +0100
committerBruno Haible <bruno@clisp.org>2011-11-04 13:26:02 +0100
commit170fb7e17af6f4620e63eadbf8291387a351dda9 (patch)
treed7da482d341fe10b5ec38e0ddcb7d64741859c56
parent9bc125c35e0919e0f2923b6c761c7f6ad4fc7a80 (diff)
downloadgnulib-170fb7e17af6f4620e63eadbf8291387a351dda9.tar.gz
New module 'mkdirat', split off from module 'openat'.
* m4/mkdirat.m4: New file. extracted from m4/openat.m4. * m4/openat.m4 (gl_FUNC_OPENAT): Don't require gl_SYS_STAT_H_DEFAULTS. Don't test for mkdirat. Don't set GNULIB_MKDIRAT, HAVE_MKDIRAT. * modules/mkdirat: New file, extracted from modules/openat. * modules/openat (Files): Remove lib/mkdirat.c. (Depends-on): Remove mkdir. (configure.ac): Remove AC_LIBOBJ of mkdirat. (Include): Remove <sys/stat.h>. * modules/mkdirat-tests: New file, extracted from modules/openat-tests. * modules/openat-tests (Files): Remove tests/test-mkdirat.c, tests/test-mkdir.h. (Depends-on): Remove ignore-value. (Makefile.am): Remove rules for test-mkdirat. * doc/posix-functions/mkdirat.texi: Mention module 'mkdirat' instead of module 'openat'. * NEWS: Mention the change.
-rw-r--r--ChangeLog20
-rw-r--r--NEWS4
-rw-r--r--doc/posix-functions/mkdirat.texi2
-rw-r--r--m4/mkdirat.m423
-rw-r--r--m4/openat.m410
-rw-r--r--modules/mkdirat43
-rw-r--r--modules/mkdirat-tests17
-rw-r--r--modules/openat6
-rw-r--r--modules/openat-tests10
9 files changed, 112 insertions, 23 deletions
diff --git a/ChangeLog b/ChangeLog
index 56cced382d..ecf87a57e1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,25 @@
2011-11-04 Bruno Haible <bruno@clisp.org>
+ New module 'mkdirat', split off from module 'openat'.
+ * m4/mkdirat.m4: New file. extracted from m4/openat.m4.
+ * m4/openat.m4 (gl_FUNC_OPENAT): Don't require gl_SYS_STAT_H_DEFAULTS.
+ Don't test for mkdirat. Don't set GNULIB_MKDIRAT, HAVE_MKDIRAT.
+ * modules/mkdirat: New file, extracted from modules/openat.
+ * modules/openat (Files): Remove lib/mkdirat.c.
+ (Depends-on): Remove mkdir.
+ (configure.ac): Remove AC_LIBOBJ of mkdirat.
+ (Include): Remove <sys/stat.h>.
+ * modules/mkdirat-tests: New file, extracted from modules/openat-tests.
+ * modules/openat-tests (Files): Remove tests/test-mkdirat.c,
+ tests/test-mkdir.h.
+ (Depends-on): Remove ignore-value.
+ (Makefile.am): Remove rules for test-mkdirat.
+ * doc/posix-functions/mkdirat.texi: Mention module 'mkdirat' instead
+ of module 'openat'.
+ * NEWS: Mention the change.
+
+2011-11-04 Bruno Haible <bruno@clisp.org>
+
closedir: Avoid warning on mingw.
* lib/closedir.c: Include <unistd.h>.
diff --git a/NEWS b/NEWS
index 5cc3a6aaeb..495c81b8df 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,10 @@ User visible incompatible changes
Date Modules Changes
+2011-11-04 openat This module no longer provides the mkdirat()
+ function. If you need this function, you now need
+ to request the 'mkdirat' module.
+
2011-11-04 openat This module no longer provides the fstatat()
function. If you need this function, you now need
to request the 'fstatat' module.
diff --git a/doc/posix-functions/mkdirat.texi b/doc/posix-functions/mkdirat.texi
index 603443c6d6..9609f2c79a 100644
--- a/doc/posix-functions/mkdirat.texi
+++ b/doc/posix-functions/mkdirat.texi
@@ -4,7 +4,7 @@
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/mkdirat.html}
-Gnulib module: openat
+Gnulib module: mkdirat
Portability problems fixed by Gnulib:
@itemize
diff --git a/m4/mkdirat.m4 b/m4/mkdirat.m4
new file mode 100644
index 0000000000..f21f7e7a28
--- /dev/null
+++ b/m4/mkdirat.m4
@@ -0,0 +1,23 @@
+# mkdirat.m4 serial 1
+dnl Copyright (C) 2004-2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# Written by Jim Meyering.
+
+AC_DEFUN([gl_FUNC_MKDIRAT],
+[
+ AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_CHECK_FUNCS_ONCE([mkdirat])
+ if test $ac_cv_func_mkdirat != yes; then
+ HAVE_MKDIRAT=0
+ fi
+])
+
+# Prerequisite of mkdirat's declaration and of lib/mkdirat.c.
+AC_DEFUN([gl_PREREQ_MKDIRAT],
+[
+ AC_REQUIRE([AC_TYPE_MODE_T])
+])
diff --git a/m4/openat.m4 b/m4/openat.m4
index 86a8b629e1..97a821f901 100644
--- a/m4/openat.m4
+++ b/m4/openat.m4
@@ -1,4 +1,4 @@
-# serial 41
+# serial 42
# See if we need to use our replacement for Solaris' openat et al functions.
dnl Copyright (C) 2004-2011 Free Software Foundation, Inc.
@@ -13,11 +13,8 @@ AC_DEFUN([gl_FUNC_OPENAT],
AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
GNULIB_OPENAT=1
- AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
- GNULIB_MKDIRAT=1
-
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
- AC_CHECK_FUNCS_ONCE([mkdirat openat])
+ AC_CHECK_FUNCS_ONCE([openat])
AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
case $ac_cv_func_openat+$gl_cv_func_lstat_dereferences_slashed_symlink in
yes+yes)
@@ -31,9 +28,6 @@ AC_DEFUN([gl_FUNC_OPENAT],
HAVE_OPENAT=0
gl_PREREQ_OPENAT;;
esac
- if test $ac_cv_func_mkdirat != yes; then
- HAVE_MKDIRAT=0
- fi
dnl This is tested at least via getcwd.c.
gl_MODULE_INDICATOR([openat])
diff --git a/modules/mkdirat b/modules/mkdirat
new file mode 100644
index 0000000000..d59689c79e
--- /dev/null
+++ b/modules/mkdirat
@@ -0,0 +1,43 @@
+Description:
+mkdirat() function: Create a directory relative to a given directory.
+
+Files:
+lib/mkdirat.c
+lib/at-func.c
+lib/openat.h
+lib/openat-priv.h
+m4/mkdirat.m4
+
+Depends-on:
+dirent
+dosname
+errno
+extensions
+fchdir
+fcntl-h
+mkdir [test $HAVE_MKDIRAT = 0]
+openat
+openat-die
+save-cwd
+stdbool
+sys_stat
+unistd
+
+configure.ac:
+gl_FUNC_MKDIRAT
+if test $HAVE_MKDIRAT = 0; then
+ AC_LIBOBJ([mkdirat])
+ gl_PREREQ_MKDIRAT
+fi
+gl_SYS_STAT_MODULE_INDICATOR([mkdirat])
+
+Makefile.am:
+
+Include:
+<sys/stat.h>
+
+License:
+GPL
+
+Maintainer:
+Jim Meyering, Eric Blake
diff --git a/modules/mkdirat-tests b/modules/mkdirat-tests
new file mode 100644
index 0000000000..103a5acaba
--- /dev/null
+++ b/modules/mkdirat-tests
@@ -0,0 +1,17 @@
+Files:
+tests/test-mkdirat.c
+tests/test-mkdir.h
+tests/signature.h
+tests/macros.h
+
+Depends-on:
+ignore-value
+progname
+symlink
+
+configure.ac:
+
+Makefile.am:
+TESTS += test-mkdirat
+check_PROGRAMS += test-mkdirat
+test_mkdirat_LDADD = $(LDADD) @LIBINTL@
diff --git a/modules/openat b/modules/openat
index 503c12135e..c051e71823 100644
--- a/modules/openat
+++ b/modules/openat
@@ -3,7 +3,6 @@ Open a file at a directory.
Files:
lib/at-func.c
-lib/mkdirat.c
lib/openat.c
lib/openat.h
lib/openat-priv.h
@@ -22,7 +21,6 @@ fstat
gettext-h
intprops
largefile
-mkdir [test $HAVE_MKDIRAT = 0]
open
openat-die
save-cwd
@@ -33,9 +31,6 @@ unistd
configure.ac:
gl_FUNC_OPENAT
AC_LIBOBJ([openat-proc])
-if test $HAVE_MKDIRAT = 0; then
- AC_LIBOBJ([mkdirat])
-fi
if test $HAVE_OPENAT = 0 || test $REPLACE_OPENAT = 1; then
AC_LIBOBJ([openat])
fi
@@ -44,7 +39,6 @@ Makefile.am:
Include:
<fcntl.h>
-<sys/stat.h>
<unistd.h>
"openat.h"
diff --git a/modules/openat-tests b/modules/openat-tests
index cb38d2e114..7cfe03e665 100644
--- a/modules/openat-tests
+++ b/modules/openat-tests
@@ -1,21 +1,15 @@
Files:
-tests/test-mkdir.h
-tests/test-mkdirat.c
tests/test-openat.c
tests/signature.h
tests/macros.h
Depends-on:
-ignore-value
progname
symlink
configure.ac:
Makefile.am:
-TESTS += \
- test-mkdirat test-openat
-check_PROGRAMS += \
- test-mkdirat test-openat
-test_mkdirat_LDADD = $(LDADD) @LIBINTL@
+TESTS += test-openat
+check_PROGRAMS += test-openat
test_openat_LDADD = $(LDADD) @LIBINTL@