From bbbe6ab72284c78c095babd875070aaac8c477dd Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 1 Nov 2008 03:30:47 +0100 Subject: Move sys_link to libreplace. --- lib/replace/README | 1 + lib/replace/libreplace.m4 | 2 +- lib/replace/replace.c | 8 ++++++++ lib/replace/replace.h | 5 +++++ 4 files changed, 15 insertions(+), 1 deletion(-) (limited to 'lib/replace') diff --git a/lib/replace/README b/lib/replace/README index a63409580c..8dcc100625 100644 --- a/lib/replace/README +++ b/lib/replace/README @@ -65,6 +65,7 @@ getifaddrs freeifaddrs utime utimes +link Types: bool diff --git a/lib/replace/libreplace.m4 b/lib/replace/libreplace.m4 index c802525eed..b58575d33d 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) +AC_CHECK_FUNCS(isatty chown link) 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 74af75ebf1..adf7932107 100644 --- a/lib/replace/replace.c +++ b/lib/replace/replace.c @@ -627,3 +627,11 @@ int rep_chown(const char *fname, uid_t uid, gid_t gid) } #endif +#ifndef HAVE_LINK +int rep_link(const char *oldpath, const char *newpath) +{ + errno = ENOSYS; + return -1; +} +#endif + diff --git a/lib/replace/replace.h b/lib/replace/replace.h index 2518d40a65..7d8bbec18f 100644 --- a/lib/replace/replace.h +++ b/lib/replace/replace.h @@ -220,6 +220,11 @@ int rep_setegid(gid_t); int rep_chown(const char *path, uid_t uid, gid_t gid); #endif +#ifndef HAVE_LINK +#define link rep_link +int rep_link(const char *oldpath, const char *newpath); +#endif + #ifndef HAVE_SETLINEBUF #define setlinebuf rep_setlinebuf void rep_setlinebuf(FILE *); -- cgit