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:
Andrew Gallatin 2000-01-29 06:31:27 +00:00
parent 6dbccd6e00
commit 2f970b91c7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=56794

View File

@ -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);