Try only testing WEXITSTATUS() after checking WIFEXITED()
authorabartlet <abartlet@1e5ffdc8-eadd-0310-9daa-9cb4117fe24b>
Fri, 7 Aug 2009 05:19:08 +0000 (05:19 +0000)
committerabartlet <abartlet@1e5ffdc8-eadd-0310-9daa-9cb4117fe24b>
Fri, 7 Aug 2009 05:19:08 +0000 (05:19 +0000)
(see wait(2))

Andrew Bartlett

git-svn-id: file:///home/svn/build-farm/trunk@886 1e5ffdc8-eadd-0310-9daa-9cb4117fe24b

timelimit.c

index 6e43544cd0351b226269585e62862cdf271618b1..1d938073f0dbede38ecb01031ad55136a791f13c 100644 (file)
@@ -92,7 +92,9 @@ int main(int argc, char *argv[])
                int status;
                pid_t pid = wait(&status);
                if (pid != -1) {
-                       ret = WEXITSTATUS(status);
+                       if (WIFEXITED(status)) {
+                               ret = WEXITSTATUS(status);
+                       }
                } else if (errno == ECHILD) {
                        break;
                }