[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
split off module unlinkat from module openat
From: |
Bruno Haible |
Subject: |
split off module unlinkat from module openat |
Date: |
Wed, 2 Nov 2011 22:32:52 +0100 |
User-agent: |
KMail/1.13.6 (Linux/2.6.37.6-0.5-desktop; KDE/4.6.0; x86_64; ; ) |
Hi Jim,
The next split-off from module 'openat' is 'unlinkat'. Here is the proposed
patch. It also fixes incorrect conditions in the module dependencies, that
no one had noticed so far. Tested on multiple platforms.
2011-11-02 Bruno Haible <address@hidden>
New module 'unlinkat', split off from module 'openat'.
* m4/unlinkat.m4: New file, extracted from m4/openat.m4.
* m4/openat.m4 (gl_FUNC_OPENAT): Don't set GNULIB_UNLINKAT,
REPLACE_UNLINKAT, HAVE_UNLINKAT. Don't test for unlinkat.
* modules/unlinkat: New file, extracted from modules/openat. Correct
the dependency conditions.
* modules/openat (Files): Remove lib/unlinkat.c.
(Depends-on): Remove rmdir, unlink.
(configure.ac): Remove AC_LIBOBJ of unlinkat.
* modules/unlinkat-tests: New file, extracted from modules/openat-tests.
* modules/openat-tests (Files): Remove tests/test-unlinkat.c,
tests/test-rmdir.h, tests/test-unlink.h.
(Depends-on): Remove unlinkdir.
(Makefile.am): Remove rules for test-unlinkat.
* doc/posix-functions/unlinkat.texi: Mention module 'unlinkat' instead
of module 'openat'.
* NEWS: Mention the change.
* modules/linkat-tests (Depends-on): Add unlinkat.
* modules/mkfifoat-tests (Depends-on): Likewise.
* modules/readlinkat-tests (Depends-on): Likewise.
================================ m4/unlinkat.m4 ================================
# unlinkat.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_UNLINKAT],
[
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
AC_CHECK_FUNCS_ONCE([unlinkat])
AC_REQUIRE([gl_FUNC_UNLINK])
AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
if test $ac_cv_func_unlinkat = no; then
HAVE_UNLINKAT=0
else
if test $gl_cv_func_lstat_dereferences_slashed_symlink != yes; then
# Solaris 9 has *at functions, but uniformly mishandles trailing
# slash in all of them.
REPLACE_UNLINKAT=1
else
# GNU/Hurd has unlinkat, but it has the same bug as unlink.
if test $REPLACE_UNLINK = 1; then
REPLACE_UNLINKAT=1
fi
fi
fi
])
=============================== modules/unlinkat ===============================
Description:
unlinkat() function: Remove a file at a directory.
Files:
lib/unlinkat.c
lib/at-func.c
lib/openat.h
lib/openat-priv.h
m4/unlinkat.m4
Depends-on:
dirent
dosname
errno
extensions
fchdir
fcntl-h
openat
rmdir [test $HAVE_UNLINKAT = 0]
save-cwd
stdbool
sys_stat
unistd
unlink [test $HAVE_UNLINKAT = 0]
configure.ac:
gl_FUNC_UNLINKAT
if test $HAVE_UNLINKAT = 0 || test $REPLACE_UNLINKAT = 1; then
AC_LIBOBJ([unlinkat])
fi
gl_UNISTD_MODULE_INDICATOR([unlinkat])
Makefile.am:
Include:
<unistd.h>
License:
GPL
Maintainer:
Jim Meyering, Eric Blake
============================ modules/unlinkat-tests ============================
Files:
tests/test-unlinkat.c
tests/test-rmdir.h
tests/test-unlink.h
tests/signature.h
tests/macros.h
Depends-on:
ignore-value
progname
symlink
unlinkdir
configure.ac:
Makefile.am:
TESTS += test-unlinkat
check_PROGRAMS += test-unlinkat
test_unlinkat_LDADD = $(LDADD) @LIBINTL@
================================================================================
--- NEWS.orig Wed Nov 2 22:25:13 2011
+++ NEWS Wed Nov 2 22:21:35 2011
@@ -12,7 +12,11 @@
Date Modules Changes
-2011-11-01 openat This module no longer provides the fchmodat()
+2011-11-03 openat This module no longer provides the unlinkat()
+ function. If you need this function, you now need
+ to request the 'unlinkat' module.
+
+2011-11-02 openat This module no longer provides the fchmodat()
function. If you need this function, you now need
to request the 'fchmodat' module.
--- doc/posix-functions/unlinkat.texi.orig Wed Nov 2 22:25:13 2011
+++ doc/posix-functions/unlinkat.texi Wed Nov 2 11:22:40 2011
@@ -4,7 +4,7 @@
POSIX specification:@*
@url{http://www.opengroup.org/onlinepubs/9699919799/functions/unlinkat.html}
-Gnulib module: openat
+Gnulib module: unlinkat
Portability problems fixed by Gnulib:
@itemize
--- m4/openat.m4.orig Wed Nov 2 22:25:13 2011
+++ m4/openat.m4 Wed Nov 2 11:30:49 2011
@@ -1,4 +1,4 @@
-# serial 39
+# serial 40
# See if we need to use our replacement for Solaris' openat et al functions.
dnl Copyright (C) 2004-2011 Free Software Foundation, Inc.
@@ -17,28 +17,19 @@
GNULIB_FSTATAT=1
GNULIB_MKDIRAT=1
- AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
- GNULIB_UNLINKAT=1
-
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
- AC_CHECK_FUNCS_ONCE([mkdirat openat unlinkat])
+ AC_CHECK_FUNCS_ONCE([mkdirat openat])
AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
- AC_REQUIRE([gl_FUNC_UNLINK])
case $ac_cv_func_openat+$gl_cv_func_lstat_dereferences_slashed_symlink in
yes+yes)
- # GNU/Hurd has unlinkat, but it has the same bug as unlink.
- if test $REPLACE_UNLINK = 1; then
- REPLACE_UNLINKAT=1
- fi ;;
+ ;;
yes+*)
# Solaris 9 has *at functions, but uniformly mishandles trailing
# slash in all of them.
REPLACE_OPENAT=1
- REPLACE_UNLINKAT=1
;;
*)
HAVE_OPENAT=0
- HAVE_UNLINKAT=0 # No known system with unlinkat but not openat
gl_PREREQ_OPENAT;;
esac
if test $ac_cv_func_mkdirat != yes; then
--- modules/linkat-tests.orig Wed Nov 2 22:25:13 2011
+++ modules/linkat-tests Wed Nov 2 21:05:20 2011
@@ -10,6 +10,7 @@
filenamecat-lgpl
getcwd-lgpl
same-inode
+unlinkat
configure.ac:
--- modules/mkfifoat-tests.orig Wed Nov 2 22:25:13 2011
+++ modules/mkfifoat-tests Wed Nov 2 21:05:19 2011
@@ -7,6 +7,7 @@
Depends-on:
ignore-value
symlink
+unlinkat
configure.ac:
--- modules/openat.orig Wed Nov 2 22:25:13 2011
+++ modules/openat Wed Nov 2 11:35:46 2011
@@ -9,7 +9,6 @@
lib/openat.h
lib/openat-priv.h
lib/openat-proc.c
-lib/unlinkat.c
m4/openat.m4
m4/mode_t.m4
@@ -28,12 +27,10 @@
mkdir [test $HAVE_MKDIRAT = 0]
open
openat-die
-rmdir [test $REPLACE_UNLINKAT = 1]
save-cwd
stdbool
sys_stat
unistd
-unlink [test $REPLACE_UNLINKAT = 1]
configure.ac:
gl_FUNC_OPENAT
@@ -47,9 +44,6 @@
if test $HAVE_OPENAT = 0 || test $REPLACE_OPENAT = 1; then
AC_LIBOBJ([openat])
fi
-if test $ac_cv_func_unlinkat = no || test $REPLACE_UNLINKAT = 1; then
- AC_LIBOBJ([unlinkat])
-fi
Makefile.am:
--- modules/openat-tests.orig Wed Nov 2 22:25:13 2011
+++ modules/openat-tests Wed Nov 2 11:40:13 2011
@@ -1,13 +1,10 @@
Files:
tests/test-lstat.h
tests/test-mkdir.h
-tests/test-rmdir.h
tests/test-stat.h
-tests/test-unlink.h
tests/test-fstatat.c
tests/test-mkdirat.c
tests/test-openat.c
-tests/test-unlinkat.c
tests/signature.h
tests/macros.h
@@ -16,16 +13,14 @@
ignore-value
progname
symlink
-unlinkdir
configure.ac:
Makefile.am:
TESTS += \
- test-fstatat test-mkdirat test-openat test-unlinkat
+ test-fstatat test-mkdirat test-openat
check_PROGRAMS += \
- test-fstatat test-mkdirat test-openat test-unlinkat
+ test-fstatat test-mkdirat test-openat
test_fstatat_LDADD = $(LDADD) @LIBINTL@
test_mkdirat_LDADD = $(LDADD) @LIBINTL@
test_openat_LDADD = $(LDADD) @LIBINTL@
-test_unlinkat_LDADD = $(LDADD) @LIBINTL@
--- modules/readlinkat-tests.orig Wed Nov 2 22:25:13 2011
+++ modules/readlinkat-tests Wed Nov 2 21:05:20 2011
@@ -7,6 +7,7 @@
Depends-on:
ignore-value
symlinkat
+unlinkat
configure.ac:
--
In memoriam Theo van Gogh
<http://en.wikipedia.org/wiki/Theo_van_Gogh_(film_director)>
- split off module unlinkat from module openat,
Bruno Haible <=