From bc2c47df4b9315ceac0f3f4800021d1b453a0262 Mon Sep 17 00:00:00 2001 From: "Jordan K. Hubbard" Date: Sat, 12 Oct 1996 18:41:26 +0000 Subject: [PATCH] Close PR#1781 - time returns with EXIT_SUCCESS on some failures Submitted-By: Tor Egge --- usr.bin/time/time.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr.bin/time/time.c b/usr.bin/time/time.c index e911d8c649d..96b160772b7 100644 --- a/usr.bin/time/time.c +++ b/usr.bin/time/time.c @@ -46,6 +46,8 @@ static char sccsid[] = "@(#)time.c 8.1 (Berkeley) 6/6/93"; #include #include #include +#include +#include #include #include @@ -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); } /* -- 2.45.2