summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2009-04-20 15:47:19 +0200
committerJelmer Vernooij <jelmer@samba.org>2009-04-20 16:25:16 +0200
commit20e1ba1c09631a3b1c850d9c8cbb42d863d0cb39 (patch)
treee5979a733570c217bda2d9cce309d51b10f89369 /lib
parente5233ccf9e32cd5d399f91512d7f310d43558e31 (diff)
downloadsamba-20e1ba1c09631a3b1c850d9c8cbb42d863d0cb39.tar.gz
samba-20e1ba1c09631a3b1c850d9c8cbb42d863d0cb39.tar.bz2
samba-20e1ba1c09631a3b1c850d9c8cbb42d863d0cb39.zip
Only define waitpid replacement if wait4 is available. (It isn't on
Windows.)
Diffstat (limited to 'lib')
-rw-r--r--lib/replace/libreplace.m42
-rw-r--r--lib/replace/replace.c2
-rw-r--r--lib/replace/system/wait.h4
3 files changed, 6 insertions, 2 deletions
diff --git a/lib/replace/libreplace.m4 b/lib/replace/libreplace.m4
index 4eae00c54f..2d90d9c7e8 100644
--- a/lib/replace/libreplace.m4
+++ b/lib/replace/libreplace.m4
@@ -106,7 +106,7 @@ AC_CHECK_HEADERS(stropts.h)
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(waitpid wait4 strlcpy strlcat initgroups memmove strdup)
AC_CHECK_FUNCS(pread pwrite strndup strcasestr strtok_r mkdtemp dup2)
AC_CHECK_FUNCS(isatty chown lchown link readlink symlink realpath)
AC_HAVE_DECL(setresuid, [#include <unistd.h>])
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);
diff --git a/lib/replace/system/wait.h b/lib/replace/system/wait.h
index 5784b1ae92..79583ad2ab 100644
--- a/lib/replace/system/wait.h
+++ b/lib/replace/system/wait.h
@@ -52,4 +52,8 @@
typedef int sig_atomic_t;
#endif
+#if !defined(HAVE_WAITPID) && defined(HAVE_WAIT4)
+int rep_waitpid(pid_t pid,int *status,int options)
+#endif
+
#endif