diff options
author | gallatin <gallatin@FreeBSD.org> | 2000-01-29 06:31:27 +0000 |
---|---|---|
committer | gallatin <gallatin@FreeBSD.org> | 2000-01-29 06:31:27 +0000 |
commit | d609003da5294a390f3dd68da9fde8875aaba1e3 (patch) | |
tree | 4c2eaa8d88a795020c77a88dfacbf9b2befb34dd /sys | |
parent | debd5713de7e2f45e53fb553c5c1fe21d5306561 (diff) | |
download | FreeBSD-src-d609003da5294a390f3dd68da9fde8875aaba1e3.zip FreeBSD-src-d609003da5294a390f3dd68da9fde8875aaba1e3.tar.gz |
changes to osf1_wait4()
- only allocate rusage struct when caller wants rusage info
- fix a stupid paren mismatch bug that was causing EPERM to get returned
to callers rather then ECHILD
Diffstat (limited to 'sys')
-rw-r--r-- | sys/alpha/osf1/osf1_misc.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/alpha/osf1/osf1_misc.c b/sys/alpha/osf1/osf1_misc.c index be49993..1fcb381 100644 --- a/sys/alpha/osf1/osf1_misc.c +++ b/sys/alpha/osf1/osf1_misc.c @@ -1320,13 +1320,15 @@ osf1_wait4(p, uap) int error; caddr_t sg; struct osf1_rusage *orusage, oru; - struct rusage *rusage, ru; + struct rusage *rusage = NULL, ru; - sg = stackgap_init(); - rusage = stackgap_alloc(&sg, sizeof(struct rusage)); orusage = SCARG(uap, rusage); - SCARG(uap, rusage) = (struct osf1_rusage *)rusage; - if ((error = wait4(p, (struct wait_args *)uap) != 0)) + if (orusage) { + sg = stackgap_init(); + rusage = stackgap_alloc(&sg, sizeof(struct rusage)); + SCARG(uap, rusage) = (struct osf1_rusage *)rusage; + } + if ((error = wait4(p, (struct wait_args *)uap))) return error; if (orusage && (error = copyin(rusage, &ru, sizeof(ru)) == 0)){ TV_CP(ru.ru_utime, oru.ru_utime); |