From 24155a405a92d06f0b6a39aeae7a9f19589bd8ed Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 22 Jan 2004 02:44:13 +0000 Subject: [PATCH] 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. --- visudo.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 -- 2.50.1