Allow to call clock_gettime() on the clock id for zombie process.
Reported by: Petr Salinger <Petr.Salinger@seznam.cz> PR: threads/180496 Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
3cbe36aed2
commit
c7c536c7f5
@ -297,14 +297,9 @@ get_cputime(struct thread *td, clockid_t clock_id, struct timespec *ats)
|
||||
PROC_UNLOCK(td2->td_proc);
|
||||
} else {
|
||||
pid = clock_id & CPUCLOCK_ID_MASK;
|
||||
p2 = pfind(pid);
|
||||
if (p2 == NULL)
|
||||
error = pget(pid, PGET_CANSEE, &p2);
|
||||
if (error != 0)
|
||||
return (EINVAL);
|
||||
error = p_cansee(td, p2);
|
||||
if (error) {
|
||||
PROC_UNLOCK(p2);
|
||||
return (EINVAL);
|
||||
}
|
||||
get_process_cputime(p2, ats);
|
||||
PROC_UNLOCK(p2);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user