From e5233ccf9e32cd5d399f91512d7f310d43558e31 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 20 Apr 2009 15:39:48 +0200 Subject: Cope with the fact that only _mkdir() exists on Windows and that it doesn't take a mode argument. --- lib/replace/replace.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/replace/replace.c') diff --git a/lib/replace/replace.c b/lib/replace/replace.c index 78c688d50c..a648391b23 100644 --- a/lib/replace/replace.c +++ b/lib/replace/replace.c @@ -31,6 +31,10 @@ #include "system/locale.h" #include "system/wait.h" +#ifdef _WIN32 +#define mkdir(d,m) _mkdir(d) +#endif + void replace_dummy(void); void replace_dummy(void) {} -- cgit From 20e1ba1c09631a3b1c850d9c8cbb42d863d0cb39 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 20 Apr 2009 15:47:19 +0200 Subject: Only define waitpid replacement if wait4 is available. (It isn't on Windows.) --- lib/replace/replace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/replace/replace.c') diff --git a/lib/replace/replace.c b/lib/replace/replace.c index a648391b23..be27744592 100644 --- a/lib/replace/replace.c +++ b/lib/replace/replace.c @@ -359,7 +359,7 @@ char *rep_strndup(const char *s, size_t n) } #endif -#ifndef HAVE_WAITPID +#if !defined(HAVE_WAITPID) && defined(HAVE_WAIT4) int rep_waitpid(pid_t pid,int *status,int options) { return wait4(pid, status, options, NULL); -- cgit From bb0f43006403106fda6231ef9b5c9674ebb53e14 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 20 Apr 2009 15:54:02 +0200 Subject: Error out at runtime when seteuid/setresuid or setegid/setresgid are not available. This means it's possible to compile libreplace when these functions are not available and use it, as long as this particular function is not used. --- lib/replace/replace.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/replace/replace.c') diff --git a/lib/replace/replace.c b/lib/replace/replace.c index be27744592..fc15717349 100644 --- a/lib/replace/replace.c +++ b/lib/replace/replace.c @@ -372,7 +372,8 @@ int rep_seteuid(uid_t euid) #ifdef HAVE_SETRESUID return setresuid(-1, euid, -1); #else -# error "You need a seteuid function" + errno = ENOSYS; + return -1; #endif } #endif @@ -383,7 +384,8 @@ int rep_setegid(gid_t egid) #ifdef HAVE_SETRESGID return setresgid(-1, egid, -1); #else -# error "You need a setegid function" + errno = ENOSYS; + return -1; #endif } #endif -- cgit