diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2001-03-26 05:35:33 +0000 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2001-03-26 05:35:33 +0000 |
commit | 9531825dd01559105b7b3c1d493e4a13d358988a (patch) | |
tree | 8c14a6740e3512fb546725d46c41f21f11d37b12 /openbsd-compat | |
parent | 8ca935655e3c0a8ddae90f8609433eca203054f0 (diff) |
- Fix pointer issues in waitpid() and wait() replaces. Patch by Lutz
Jaenicke <Lutz.Jaenicke@aet.TU-Cottbus.DE>
Diffstat (limited to 'openbsd-compat')
-rw-r--r-- | openbsd-compat/bsd-nextstep.c | 5 | ||||
-rw-r--r-- | openbsd-compat/bsd-waitpid.c | 6 |
2 files changed, 7 insertions, 4 deletions
diff --git a/openbsd-compat/bsd-nextstep.c b/openbsd-compat/bsd-nextstep.c index 64962d01..85b298a4 100644 --- a/openbsd-compat/bsd-nextstep.c +++ b/openbsd-compat/bsd-nextstep.c @@ -22,7 +22,7 @@ #include "includes.h" -RCSID("$Id: bsd-nextstep.c,v 1.3 2001/02/09 01:55:36 djm Exp $"); +RCSID("$Id: bsd-nextstep.c,v 1.4 2001/03/26 05:35:34 mouring Exp $"); #ifdef HAVE_NEXT #include <errno.h> @@ -37,7 +37,8 @@ posix_wait(int *status) #undef wait /* Use NeXT's wait() function */ wait_pid = wait(&statusp); - status = (int *) statusp.w_status; + if (status) + *status = (int) statusp.w_status; return wait_pid; } diff --git a/openbsd-compat/bsd-waitpid.c b/openbsd-compat/bsd-waitpid.c index 1a96bbf7..47b4446d 100644 --- a/openbsd-compat/bsd-waitpid.c +++ b/openbsd-compat/bsd-waitpid.c @@ -22,7 +22,7 @@ #include "includes.h" -RCSID("$Id: bsd-waitpid.c,v 1.2 2001/02/09 01:55:36 djm Exp $"); +RCSID("$Id: bsd-waitpid.c,v 1.3 2001/03/26 05:35:34 mouring Exp $"); #ifndef HAVE_WAITPID #include <errno.h> @@ -43,7 +43,9 @@ waitpid(int pid, int *stat_loc, int options) pid = 0; /* wait4() wants pid=0 for indiscriminate wait. */ } wait_pid = wait4(pid, &statusp, options, NULL); - stat_loc = (int *)statusp.w_status; + if (stat_loc) + *stat_loc = (int) statusp.w_status; + return wait_pid; } |