symlink: use throughout gnulib
authorEric Blake <ebb9@byu.net>
Sun, 20 Sep 2009 03:58:11 +0000 (21:58 -0600)
committerEric Blake <ebb9@byu.net>
Wed, 23 Sep 2009 10:57:44 +0000 (04:57 -0600)
* 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>
19 files changed:
ChangeLog
lib/symlinkat.c
m4/symlinkat.m4
modules/canonicalize-lgpl-tests
modules/canonicalize-tests
modules/lstat-tests
modules/openat-tests
modules/remove-tests
modules/rmdir-tests
modules/symlinkat
modules/unlink-tests
tests/test-canonicalize-lgpl.c
tests/test-canonicalize.c
tests/test-fstatat.c
tests/test-lstat.c
tests/test-remove.c
tests/test-rmdir.c
tests/test-unlink.c
tests/test-unlinkat.c

index 386e3b51a24cdcfd4e730c704b1a2105255555ba..ab0e91a221209d3f548f639be1bce22770cbd85c 100644 (file)
--- 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.
index fd129ea014054113fcc3df2239bb117e44df29f9..d9032b93a440f42abb9c737e967210ac751507b2 100644 (file)
@@ -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>
 
index 93980d56da55ccf4b0431bea1ebb0a7d0167eb1a..27fa344bcb5d65b94a6d33064444913bcab673eb 100644 (file)
@@ -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
index cf96c58d5416bd6716514885a00479dd64a1db2b..39c348440095cddc0f77b01028abd5775664a789 100644 (file)
@@ -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
index 202d639f5c4b712affafad51fccafd6aaf566497..b10b61d666ef3d483b1334c6bafccf70a5336d8d 100644 (file)
@@ -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
index acd2bcd58ce192ef236fd9587206820590f9a89a..1a34c34f28b5c02d0863ca118ea537d1e4801d48 100644 (file)
@@ -6,9 +6,9 @@ Depends-on:
 errno
 same-inode
 stdbool
+symlink
 
 configure.ac:
-AC_CHECK_FUNCS_ONCE([symlink])
 
 Makefile.am:
 TESTS += test-lstat
index 7134f2c471389414da70172e2edb18f5ccbd7a64..0d0ff8ce1d3ff1e35a2ceb3bb98e486f344ec1ef 100644 (file)
@@ -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
index fdc26c27235487a37d47f91708da4e91afb27572..665ebe4350c897eb261dc7c80d093da5acace0ad 100644 (file)
@@ -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
index fca8a776f26b1f8d8d1f4c85f12dee5e2b80ced4..0fa5efee9e8d798c73e483f9339f31ddc784a420 100644 (file)
@@ -4,9 +4,9 @@ tests/test-rmdir.c
 
 Depends-on:
 stdbool
+symlink
 
 configure.ac:
-AC_CHECK_FUNCS_ONCE([symlink])
 
 Makefile.am:
 TESTS += test-rmdir
index 2da3ba42feafc18a1a6d977a957f50851183f493..1a065fdfe275410fec4951cd1a193ada37b6a181 100644 (file)
@@ -10,6 +10,7 @@ extensions
 fcntl-h
 openat
 readlink
+symlink
 unistd
 
 configure.ac:
index f0930f000faf3e03bbc7c775a43ec8527cefda60..b9be842240024dcca27c28b61743189e55574e63 100644 (file)
@@ -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
index 39025fa3948ae9eba759ddd5bb90ee94c56a9674..6efd714e8626accec6fa09390501b4c10568eaf8 100644 (file)
 
 #include "same-inode.h"
 
-#if !HAVE_SYMLINK
-# define symlink(a,b) (-1)
-#endif /* !HAVE_SYMLINK */
-
 #define ASSERT(expr) \
   do                                                                        \
     {                                                                       \
index 463297f61678fe8d7e89d17f15a21f1681f505f8..658987722438d00f2007c8c923710a802b139a7d 100644 (file)
 
 #include "same-inode.h"
 
-#if !HAVE_SYMLINK
-# define symlink(a,b) (-1)
-#endif
-
 #define ASSERT(expr) \
   do                                                                        \
     {                                                                       \
index a70721a79d9485d2f64186e9a8989eb0f21bafec..28a71fad9acc40be92afb7db38bcf484db770d4f 100644 (file)
 #include "pathmax.h"
 #include "same-inode.h"
 
-#if !HAVE_SYMLINK
-# define symlink(a,b) (-1)
-#endif
-
 #define ASSERT(expr) \
   do                                                                         \
     {                                                                        \
index cb9963d3b5b9919b27e1f4b34149f03b04189bf8..89edb1fa02b7f96d0f8eb7ea95fe0c6fad1ce881 100644 (file)
 
 #include "same-inode.h"
 
-#if !HAVE_SYMLINK
-# define symlink(a,b) (-1)
-#endif
-
 #define ASSERT(expr) \
   do                                                                         \
     {                                                                        \
index 787cde26351f6bbd6d80e288fbc18f8649d15bb7..99edb0c14f3a6ad1275ee9e87609b7a530c8ec13 100644 (file)
 #include <sys/stat.h>
 #include <unistd.h>
 
-#if !HAVE_SYMLINK
-# define symlink(a,b) (-1)
-#endif
-
 #define ASSERT(expr) \
   do                                                                         \
     {                                                                        \
index d7e4da349d35dfeb7b661ec84d6aa1e9f1a05a4a..9d8eb5ab0b5be5872d7bb5ad6ab2544ef8d8a93e 100644 (file)
 #include <stdlib.h>
 #include <sys/stat.h>
 
-#if !HAVE_SYMLINK
-# define symlink(a,b) (-1)
-#endif
-
 #define ASSERT(expr) \
   do                                                                         \
     {                                                                        \
index f5df9b6816291dccf49340e64bb2ad1af1b08f25..0c8dc6f721d506df9777e7bbda4c830e0ea8a96e 100644 (file)
 
 #include "unlinkdir.h"
 
-#if !HAVE_SYMLINK
-# define symlink(a,b) (-1)
-#endif
-
 #define ASSERT(expr) \
   do                                                                         \
     {                                                                        \
index 8e0a1cd7d78e1754078f1aa2e274a2dd76a92398..785ede4cae79d9a5d70380819c4b8860b53abff5 100644 (file)
 
 #include "unlinkdir.h"
 
-#if !HAVE_SYMLINK
-# define symlink(a,b) (-1)
-#endif
-
 #define ASSERT(expr) \
   do                                                                         \
     {                                                                        \