summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <Todd.Miller@courtesan.com>2004-01-22 02:44:13 +0000
committerTodd C. Miller <Todd.Miller@courtesan.com>2004-01-22 02:44:13 +0000
commit3a404b29a76aae40e7121fe62ca86357d6e6e69d (patch)
treee268dfc8005b85718d58451817b3db1873708252
parentb27f8f03c5e8be9ba3f991670e0bfa498b43ebdd (diff)
downloadsudo-3a404b29a76aae40e7121fe62ca86357d6e6e69d.tar.gz
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.
-rw-r--r--visudo.c5
1 files 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