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:
Jordan K. Hubbard 1996-10-12 18:41:26 +00:00
parent e07fd62c16
commit bc2c47df4b

View File

@ -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);
}
/*