mirror of
git://git.musl-libc.org/musl
synced 2025-03-06 20:48:29 +01:00
wait4: fix missing rusage on x32 due to wrong success condition
Resource usage data is filled by the kernel only when wait4 returns
a pid, i.e. a positive value.
Commit 5850546e96
introduced this bug,
possibly because of copy-pasting from getrusage.
This commit is contained in:
parent
9b12982d52
commit
c1b42c4a3a
1 changed files with 1 additions and 1 deletions
|
@ -12,7 +12,7 @@ pid_t wait4(pid_t pid, int *status, int options, struct rusage *ru)
|
|||
if (ru) {
|
||||
long long kru64[18];
|
||||
r = __syscall(SYS_wait4_time64, pid, status, options, kru64);
|
||||
if (!r) {
|
||||
if (r > 0) {
|
||||
ru->ru_utime = (struct timeval)
|
||||
{ .tv_sec = kru64[0], .tv_usec = kru64[1] };
|
||||
ru->ru_stime = (struct timeval)
|
||||
|
|
Loading…
Add table
Reference in a new issue