# HG changeset patch # User Eric Blake # Date 1253419091 21600 # Node ID aee865e7b49f9dbba0945c2b8aa44908fae53526 # Parent e0c5d88f8c3bdf806c554b2def5910d1d41c7f29 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 diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,26 @@ 2009-09-23 Eric Blake + 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 --- a/lib/symlinkat.c +++ b/lib/symlinkat.c @@ -21,7 +21,8 @@ #include #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 diff --git a/m4/symlinkat.m4 b/m4/symlinkat.m4 --- 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_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 --- a/modules/canonicalize-lgpl-tests +++ b/modules/canonicalize-lgpl-tests @@ -3,9 +3,9 @@ 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 --- a/modules/canonicalize-tests +++ b/modules/canonicalize-tests @@ -4,9 +4,9 @@ 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 --- a/modules/lstat-tests +++ b/modules/lstat-tests @@ -6,9 +6,9 @@ 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 --- a/modules/openat-tests +++ b/modules/openat-tests @@ -9,10 +9,10 @@ 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 --- a/modules/remove-tests +++ b/modules/remove-tests @@ -2,10 +2,10 @@ 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 --- a/modules/rmdir-tests +++ b/modules/rmdir-tests @@ -4,9 +4,9 @@ Depends-on: stdbool +symlink configure.ac: -AC_CHECK_FUNCS_ONCE([symlink]) Makefile.am: TESTS += test-rmdir diff --git a/modules/symlinkat b/modules/symlinkat --- a/modules/symlinkat +++ b/modules/symlinkat @@ -10,6 +10,7 @@ fcntl-h openat readlink +symlink unistd configure.ac: diff --git a/modules/unlink-tests b/modules/unlink-tests --- a/modules/unlink-tests +++ b/modules/unlink-tests @@ -4,10 +4,10 @@ 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 --- 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 --- 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 --- 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 --- 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 --- a/tests/test-remove.c +++ b/tests/test-remove.c @@ -27,10 +27,6 @@ #include #include -#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 --- a/tests/test-rmdir.c +++ b/tests/test-rmdir.c @@ -27,10 +27,6 @@ #include #include -#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 --- 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 --- 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 \ { \