From e8cda43e171c1aa8f4b858228e715290d400691c Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 1 Nov 2008 03:35:58 +0100 Subject: Move sys_symlink() to libreplace. --- lib/replace/README | 1 + lib/replace/libreplace.m4 | 2 +- lib/replace/replace.c | 8 ++++++++ lib/replace/replace.h | 6 ++++++ 4 files changed, 16 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/replace/README b/lib/replace/README index ed0b866e85..f189e8716f 100644 --- a/lib/replace/README +++ b/lib/replace/README @@ -67,6 +67,7 @@ utime utimes link readlink +symlink Types: bool diff --git a/lib/replace/libreplace.m4 b/lib/replace/libreplace.m4 index 64df4ec575..a93a9dad45 100644 --- a/lib/replace/libreplace.m4 +++ b/lib/replace/libreplace.m4 @@ -108,7 +108,7 @@ AC_CHECK_FUNCS(seteuid setresuid setegid setresgid chroot bzero strerror) AC_CHECK_FUNCS(vsyslog setlinebuf mktime ftruncate chsize rename) AC_CHECK_FUNCS(waitpid strlcpy strlcat initgroups memmove strdup) AC_CHECK_FUNCS(pread pwrite strndup strcasestr strtok_r mkdtemp) -AC_CHECK_FUNCS(isatty chown link readlink) +AC_CHECK_FUNCS(isatty chown link readlink symlink) AC_HAVE_DECL(setresuid, [#include ]) AC_HAVE_DECL(setresgid, [#include ]) AC_HAVE_DECL(errno, [#include ]) diff --git a/lib/replace/replace.c b/lib/replace/replace.c index 00a205d472..37705b93cd 100644 --- a/lib/replace/replace.c +++ b/lib/replace/replace.c @@ -642,3 +642,11 @@ int rep_readlink(const char *path, char *buf, size_t bufsiz) return -1; } #endif + +#ifndef HAVE_SYMLINK +int rep_symlink(const char *oldpath, const char *newpath) +{ + errno = ENOSYS; + return -1; +} +#endif diff --git a/lib/replace/replace.h b/lib/replace/replace.h index fe01a8613e..f56c5b0dc9 100644 --- a/lib/replace/replace.h +++ b/lib/replace/replace.h @@ -230,6 +230,12 @@ int rep_link(const char *oldpath, const char *newpath); int rep_readlink(const char *path, char *buf, size_t bufsize); #endif +#ifndef HAVE_SYMLINK +#define symlink rep_symlink +int rep_symlink(const char *oldpath, const char *newpath); +#endif + + #ifndef HAVE_SETLINEBUF #define setlinebuf rep_setlinebuf void rep_setlinebuf(FILE *); -- cgit