diff options
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/replace.c | 10 | ||||
-rw-r--r-- | source4/lib/signal.c | 2 | ||||
-rw-r--r-- | source4/lib/system.c | 2 | ||||
-rw-r--r-- | source4/lib/tdb/tools/tdbtorture.c | 2 |
4 files changed, 14 insertions, 2 deletions
diff --git a/source4/lib/replace.c b/source4/lib/replace.c index 28c60130f8..c2180a168f 100644 --- a/source4/lib/replace.c +++ b/source4/lib/replace.c @@ -19,6 +19,7 @@ */ #include "includes.h" +#include "system/wait.h" void replace_dummy(void); void replace_dummy(void) {} @@ -546,3 +547,12 @@ int get_time_zone(time_t t) return i; } #endif + +int sys_waitpid(pid_t pid,int *status,int options) +{ +#ifdef HAVE_WAITPID + return waitpid(pid,status,options); +#else /* USE_WAITPID */ + return wait4(pid, status, options, NULL); +#endif /* USE_WAITPID */ +} diff --git a/source4/lib/signal.c b/source4/lib/signal.c index 00fc214639..bff4b91c1a 100644 --- a/source4/lib/signal.c +++ b/source4/lib/signal.c @@ -27,7 +27,7 @@ static void sig_cld(int signum) { - while (waitpid((pid_t)-1,(int *)NULL, WNOHANG) > 0) + while (sys_waitpid((pid_t)-1,(int *)NULL, WNOHANG) > 0) ; /* diff --git a/source4/lib/system.c b/source4/lib/system.c index 2baa412622..906219bd91 100644 --- a/source4/lib/system.c +++ b/source4/lib/system.c @@ -21,6 +21,7 @@ #include "includes.h" #include "system/network.h" +#include "system/wait.h" /* The idea is that this file will eventually have wrappers around all @@ -555,3 +556,4 @@ struct ipv4_addr sys_inet_makeaddr(int net, int host) in2.s_addr = in.s_addr; return in2; } + diff --git a/source4/lib/tdb/tools/tdbtorture.c b/source4/lib/tdb/tools/tdbtorture.c index 005a2713af..95eb71281c 100644 --- a/source4/lib/tdb/tools/tdbtorture.c +++ b/source4/lib/tdb/tools/tdbtorture.c @@ -217,7 +217,7 @@ static int traverse_fn(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA dbuf, if (getpid() == pids[0]) { for (i=0;i<NPROC-1;i++) { int status; - if (waitpid(pids[i+1], &status, 0) != pids[i+1]) { + if (sys_waitpid(pids[i+1], &status, 0) != pids[i+1]) { printf("failed to wait for %d\n", (int)pids[i+1]); exit(1); |