summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <ebb9@byu.net>2009-09-19 21:58:11 -0600
committerEric Blake <ebb9@byu.net>2009-09-23 04:57:44 -0600
commit7eba2f98240cd9a9c0cc81b4ebb7103bbe8630a7 (patch)
tree36909b93636189d904f43257d3373245a6fae287
parentd9d5054ceb34c7e5b1dc64e5477ac6f89969a423 (diff)
downloadgnulib-7eba2f98240cd9a9c0cc81b4ebb7103bbe8630a7.tar.gz
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. Signed-off-by: Eric Blake <ebb9@byu.net>
-rw-r--r--ChangeLog21
-rw-r--r--lib/symlinkat.c3
-rw-r--r--m4/symlinkat.m44
-rw-r--r--modules/canonicalize-lgpl-tests2
-rw-r--r--modules/canonicalize-tests2
-rw-r--r--modules/lstat-tests2
-rw-r--r--modules/openat-tests2
-rw-r--r--modules/remove-tests2
-rw-r--r--modules/rmdir-tests2
-rw-r--r--modules/symlinkat1
-rw-r--r--modules/unlink-tests2
-rw-r--r--tests/test-canonicalize-lgpl.c4
-rw-r--r--tests/test-canonicalize.c4
-rw-r--r--tests/test-fstatat.c4
-rw-r--r--tests/test-lstat.c4
-rw-r--r--tests/test-remove.c4
-rw-r--r--tests/test-rmdir.c4
-rw-r--r--tests/test-unlink.c4
-rw-r--r--tests/test-unlinkat.c4
19 files changed, 33 insertions, 42 deletions
diff --git a/ChangeLog b/ChangeLog
index 386e3b51a2..ab0e91a221 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,26 @@
2009-09-23 Eric Blake <ebb9@byu.net>
+ 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.
diff --git a/lib/symlinkat.c b/lib/symlinkat.c
index fd129ea014..d9032b93a4 100644
--- a/lib/symlinkat.c
+++ b/lib/symlinkat.c
@@ -21,7 +21,8 @@
#include <unistd.h>
#if !HAVE_SYMLINK
-/* Mingw lacks symlink, so this wrapper is trivial. */
+/* Mingw lacks symlink, and it is more efficient to provide a trivial
+ wrapper than to go through at-func.c to call rpl_symlink. */
# include <errno.h>
diff --git a/m4/symlinkat.m4 b/m4/symlinkat.m4
index 93980d56da..27fa344bcb 100644
--- a/m4/symlinkat.m4
+++ b/m4/symlinkat.m4
@@ -1,4 +1,4 @@
-# serial 2
+# serial 3
# See if we need to provide symlinkat/readlinkat replacement.
dnl Copyright (C) 2009 Free Software Foundation, Inc.
@@ -13,7 +13,7 @@ AC_DEFUN([gl_FUNC_SYMLINKAT],
AC_REQUIRE([gl_FUNC_OPENAT])
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
- AC_CHECK_FUNCS_ONCE([symlink symlinkat readlinkat])
+ AC_CHECK_FUNCS_ONCE([symlinkat readlinkat])
if test $ac_cv_func_symlinkat = no; then
# No known system has readlinkat but not symlinkat
HAVE_SYMLINKAT=0
diff --git a/modules/canonicalize-lgpl-tests b/modules/canonicalize-lgpl-tests
index cf96c58d54..39c3484400 100644
--- a/modules/canonicalize-lgpl-tests
+++ b/modules/canonicalize-lgpl-tests
@@ -3,9 +3,9 @@ tests/test-canonicalize-lgpl.c
Depends-on:
same-inode
+symlink
configure.ac:
-AC_CHECK_FUNCS_ONCE([symlink])
Makefile.am:
TESTS += test-canonicalize-lgpl
diff --git a/modules/canonicalize-tests b/modules/canonicalize-tests
index 202d639f5c..b10b61d666 100644
--- a/modules/canonicalize-tests
+++ b/modules/canonicalize-tests
@@ -4,9 +4,9 @@ tests/test-canonicalize.c
Depends-on:
progname
same-inode
+symlink
configure.ac:
-AC_CHECK_FUNCS_ONCE([symlink])
Makefile.am:
TESTS += test-canonicalize
diff --git a/modules/lstat-tests b/modules/lstat-tests
index acd2bcd58c..1a34c34f28 100644
--- a/modules/lstat-tests
+++ b/modules/lstat-tests
@@ -6,9 +6,9 @@ Depends-on:
errno
same-inode
stdbool
+symlink
configure.ac:
-AC_CHECK_FUNCS_ONCE([symlink])
Makefile.am:
TESTS += test-lstat
diff --git a/modules/openat-tests b/modules/openat-tests
index 7134f2c471..0d0ff8ce1d 100644
--- a/modules/openat-tests
+++ b/modules/openat-tests
@@ -9,10 +9,10 @@ tests/test-unlinkat.c
Depends-on:
pathmax
+symlink
unlinkdir
configure.ac:
-AC_CHECK_FUNCS_ONCE([symlink])
Makefile.am:
TESTS += test-fstatat test-openat test-unlinkat
diff --git a/modules/remove-tests b/modules/remove-tests
index fdc26c2723..665ebe4350 100644
--- a/modules/remove-tests
+++ b/modules/remove-tests
@@ -2,10 +2,10 @@ Files:
tests/test-remove.c
Depends-on:
+symlink
sys_stat
configure.ac:
-AC_CHECK_FUNCS_ONCE([symlink])
Makefile.am:
TESTS += test-remove
diff --git a/modules/rmdir-tests b/modules/rmdir-tests
index fca8a776f2..0fa5efee9e 100644
--- a/modules/rmdir-tests
+++ b/modules/rmdir-tests
@@ -4,9 +4,9 @@ tests/test-rmdir.c
Depends-on:
stdbool
+symlink
configure.ac:
-AC_CHECK_FUNCS_ONCE([symlink])
Makefile.am:
TESTS += test-rmdir
diff --git a/modules/symlinkat b/modules/symlinkat
index 2da3ba42fe..1a065fdfe2 100644
--- a/modules/symlinkat
+++ b/modules/symlinkat
@@ -10,6 +10,7 @@ extensions
fcntl-h
openat
readlink
+symlink
unistd
configure.ac:
diff --git a/modules/unlink-tests b/modules/unlink-tests
index f0930f000f..b9be842240 100644
--- a/modules/unlink-tests
+++ b/modules/unlink-tests
@@ -4,10 +4,10 @@ tests/test-unlink.c
Depends-on:
stdbool
+symlink
unlinkdir
configure.ac:
-AC_CHECK_FUNCS_ONCE([symlink])
Makefile.am:
TESTS += test-unlink
diff --git a/tests/test-canonicalize-lgpl.c b/tests/test-canonicalize-lgpl.c
index 39025fa394..6efd714e86 100644
--- a/tests/test-canonicalize-lgpl.c
+++ b/tests/test-canonicalize-lgpl.c
@@ -29,10 +29,6 @@
#include "same-inode.h"
-#if !HAVE_SYMLINK
-# define symlink(a,b) (-1)
-#endif /* !HAVE_SYMLINK */
-
#define ASSERT(expr) \
do \
{ \
diff --git a/tests/test-canonicalize.c b/tests/test-canonicalize.c
index 463297f616..6589877224 100644
--- a/tests/test-canonicalize.c
+++ b/tests/test-canonicalize.c
@@ -30,10 +30,6 @@
#include "same-inode.h"
-#if !HAVE_SYMLINK
-# define symlink(a,b) (-1)
-#endif
-
#define ASSERT(expr) \
do \
{ \
diff --git a/tests/test-fstatat.c b/tests/test-fstatat.c
index a70721a79d..28a71fad9a 100644
--- a/tests/test-fstatat.c
+++ b/tests/test-fstatat.c
@@ -31,10 +31,6 @@
#include "pathmax.h"
#include "same-inode.h"
-#if !HAVE_SYMLINK
-# define symlink(a,b) (-1)
-#endif
-
#define ASSERT(expr) \
do \
{ \
diff --git a/tests/test-lstat.c b/tests/test-lstat.c
index cb9963d3b5..89edb1fa02 100644
--- a/tests/test-lstat.c
+++ b/tests/test-lstat.c
@@ -29,10 +29,6 @@
#include "same-inode.h"
-#if !HAVE_SYMLINK
-# define symlink(a,b) (-1)
-#endif
-
#define ASSERT(expr) \
do \
{ \
diff --git a/tests/test-remove.c b/tests/test-remove.c
index 787cde2635..99edb0c14f 100644
--- a/tests/test-remove.c
+++ b/tests/test-remove.c
@@ -27,10 +27,6 @@
#include <sys/stat.h>
#include <unistd.h>
-#if !HAVE_SYMLINK
-# define symlink(a,b) (-1)
-#endif
-
#define ASSERT(expr) \
do \
{ \
diff --git a/tests/test-rmdir.c b/tests/test-rmdir.c
index d7e4da349d..9d8eb5ab0b 100644
--- a/tests/test-rmdir.c
+++ b/tests/test-rmdir.c
@@ -27,10 +27,6 @@
#include <stdlib.h>
#include <sys/stat.h>
-#if !HAVE_SYMLINK
-# define symlink(a,b) (-1)
-#endif
-
#define ASSERT(expr) \
do \
{ \
diff --git a/tests/test-unlink.c b/tests/test-unlink.c
index f5df9b6816..0c8dc6f721 100644
--- a/tests/test-unlink.c
+++ b/tests/test-unlink.c
@@ -30,10 +30,6 @@
#include "unlinkdir.h"
-#if !HAVE_SYMLINK
-# define symlink(a,b) (-1)
-#endif
-
#define ASSERT(expr) \
do \
{ \
diff --git a/tests/test-unlinkat.c b/tests/test-unlinkat.c
index 8e0a1cd7d7..785ede4cae 100644
--- a/tests/test-unlinkat.c
+++ b/tests/test-unlinkat.c
@@ -29,10 +29,6 @@
#include "unlinkdir.h"
-#if !HAVE_SYMLINK
-# define symlink(a,b) (-1)
-#endif
-
#define ASSERT(expr) \
do \
{ \