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 386e3b5..ab0e91a 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 fd129ea..d9032b9 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 93980d5..27fa344 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 cf96c58..39c3484 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 202d639..b10b61d 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 acd2bcd..1a34c34 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 7134f2c..0d0ff8c 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 fdc26c2..665ebe4 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 fca8a77..0fa5efe 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 2da3ba4..1a065fd 100644 (file)
@@ -10,6 +10,7 @@ extensions
 fcntl-h
 openat
 readlink
+symlink
 unistd
 
 configure.ac:
index f0930f0..b9be842 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 39025fa..6efd714 100644 (file)
 
 #include "same-inode.h"
 
-#if !HAVE_SYMLINK
-# define symlink(a,b) (-1)
-#endif /* !HAVE_SYMLINK */
-
 #define ASSERT(expr) \
   do                                                                        \
     {                                                                       \
index 463297f..6589877 100644 (file)
 
 #include "same-inode.h"
 
-#if !HAVE_SYMLINK
-# define symlink(a,b) (-1)
-#endif
-
 #define ASSERT(expr) \
   do                                                                        \
     {                                                                       \
index a70721a..28a71fa 100644 (file)
 #include "pathmax.h"
 #include "same-inode.h"
 
-#if !HAVE_SYMLINK
-# define symlink(a,b) (-1)
-#endif
-
 #define ASSERT(expr) \
   do                                                                         \
     {                                                                        \
index cb9963d..89edb1f 100644 (file)
 
 #include "same-inode.h"
 
-#if !HAVE_SYMLINK
-# define symlink(a,b) (-1)
-#endif
-
 #define ASSERT(expr) \
   do                                                                         \
     {                                                                        \
index 787cde2..99edb0c 100644 (file)
 #include <sys/stat.h>
 #include <unistd.h>
 
-#if !HAVE_SYMLINK
-# define symlink(a,b) (-1)
-#endif
-
 #define ASSERT(expr) \
   do                                                                         \
     {                                                                        \
index d7e4da3..9d8eb5a 100644 (file)
 #include <stdlib.h>
 #include <sys/stat.h>
 
-#if !HAVE_SYMLINK
-# define symlink(a,b) (-1)
-#endif
-
 #define ASSERT(expr) \
   do                                                                         \
     {                                                                        \
index f5df9b6..0c8dc6f 100644 (file)
 
 #include "unlinkdir.h"
 
-#if !HAVE_SYMLINK
-# define symlink(a,b) (-1)
-#endif
-
 #define ASSERT(expr) \
   do                                                                         \
     {                                                                        \
index 8e0a1cd..785ede4 100644 (file)
 
 #include "unlinkdir.h"
 
-#if !HAVE_SYMLINK
-# define symlink(a,b) (-1)
-#endif
-
 #define ASSERT(expr) \
   do                                                                         \
     {                                                                        \