From 9306738debb4ae38a43cc158c24c46debd86fb71 Mon Sep 17 00:00:00 2001 From: "Bruno G. Albuquerque" Date: Tue, 17 Nov 2009 16:00:10 +0000 Subject: [PATCH] - Only try to get usage info if there was no error with waitpid. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34092 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/libs/bsd/wait.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libs/bsd/wait.c b/src/libs/bsd/wait.c index fe1a31518d..c23ef1175f 100644 --- a/src/libs/bsd/wait.c +++ b/src/libs/bsd/wait.c @@ -19,7 +19,9 @@ wait3(int *status, int options, struct rusage *rusage) { pid_t wait4(pid_t pid, int *status, int options, struct rusage *rusage) { pid_t waitPid = waitpid(pid, status, options); - getrusage(RUSAGE_CHILDREN, rusage); + if (waitPid != -1) { + getrusage(RUSAGE_CHILDREN, rusage); + } return waitPid; }