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
This commit is contained in:
parent
d10d336882
commit
80825fcd76
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user