Close PR#1781 - time returns with EXIT_SUCCESS on some failures
Submitted-By: Tor Egge <Tor.Egge@idt.ntnu.no>
This commit is contained in:
parent
e07fd62c16
commit
bc2c47df4b
@ -46,6 +46,8 @@ static char sccsid[] = "@(#)time.c 8.1 (Berkeley) 6/6/93";
|
||||
#include <sys/resource.h>
|
||||
#include <sys/signal.h>
|
||||
#include <sys/sysctl.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
#include <err.h>
|
||||
#include <stdio.h>
|
||||
@ -149,7 +151,7 @@ main(argc, argv)
|
||||
fprintf(stderr, "%10ld %s\n",
|
||||
ru.ru_nivcsw, "involuntary context switches");
|
||||
}
|
||||
exit (status>>8);
|
||||
exit (WIFEXITED(status) ? WEXITSTATUS(status) : EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user