diff options
author | Todd C. Miller <Todd.Miller@courtesan.com> | 2004-01-22 02:44:13 +0000 |
---|---|---|
committer | Todd C. Miller <Todd.Miller@courtesan.com> | 2004-01-22 02:44:13 +0000 |
commit | 3a404b29a76aae40e7121fe62ca86357d6e6e69d (patch) | |
tree | e268dfc8005b85718d58451817b3db1873708252 | |
parent | b27f8f03c5e8be9ba3f991670e0bfa498b43ebdd (diff) | |
download | sudo-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.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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 |