Only define waitpid replacement if wait4 is available. (It isn't on
authorJelmer Vernooij <jelmer@samba.org>
Mon, 20 Apr 2009 13:47:19 +0000 (15:47 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Mon, 20 Apr 2009 14:25:16 +0000 (16:25 +0200)
Windows.)

lib/replace/libreplace.m4
lib/replace/replace.c
lib/replace/system/wait.h

index 4eae00c54f913f7b922994c9e50a176de3223166..2d90d9c7e859cce0294182eb21c6b549188c953e 100644 (file)
@@ -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>])
index a648391b23d4ebd2c859f044400174ef22e969f9..be277445923ac43d131464d8b7fcaa4dae951e8f 100644 (file)
@@ -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);
index 5784b1ae924d139855ba25fb973bda72df69c652..79583ad2abcd17d48612ed8f628160c776b62597 100644 (file)
@@ -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