From: Todd C. Miller Date: Thu, 22 Jan 2004 02:44:13 +0000 (+0000) Subject: Use WIFEXITED and WEXITSTATUS macros. If there are systems out there X-Git-Tag: SUDO_1_6_8~211 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=24155a405a92d06f0b6a39aeae7a9f19589bd8ed;p=sudo Use WIFEXITED and WEXITSTATUS macros. If there are systems out there that want to run sudo that still don't support these we can try to deal with that later. --- diff --git a/visudo.c b/visudo.c index cf3dfdba6..0c657d4be 100644 --- a/visudo.c +++ b/visudo.c @@ -638,8 +638,9 @@ run_command(path, argv) (void) sigprocmask(SIG_SETMASK, &oset, NULL); - /* XXX - should use WEXITSTATUS() */ - return(pid == -1 ? -1 : (status >> 8)); + if (pid == -1 || !WIFEXITED(status)) + return(-1); + return(WEXITSTATUS(status)); } static int