diff options
author | Martin Pool <mbp@samba.org> | 2003-01-15 05:27:33 +0000 |
---|---|---|
committer | Martin Pool <mbp@samba.org> | 2003-01-15 05:27:33 +0000 |
commit | ec894b56953a48a3591f3a127c7459f95c9935e3 (patch) | |
tree | 8b71673f70f3f1e7b9a848906753e0eac11032af /source3 | |
parent | 3710ea2223f51f15940b27dcb835035d9c16f0c6 (diff) | |
download | samba-ec894b56953a48a3591f3a127c7459f95c9935e3.tar.gz samba-ec894b56953a48a3591f3a127c7459f95c9935e3.tar.bz2 samba-ec894b56953a48a3591f3a127c7459f95c9935e3.zip |
One more from waitpid() audit: Correctly interpret waitstatus when a
child fails. Possibly this was causing smbmount to exit(0) when it
really should have indicated a failure.
(This used to be commit 1e33083fe66dfc1e168ffeb2f9d87953534a2d5d)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/client/smbmount.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source3/client/smbmount.c b/source3/client/smbmount.c index 33adfc4d48..54970f7030 100644 --- a/source3/client/smbmount.c +++ b/source3/client/smbmount.c @@ -78,8 +78,12 @@ static void daemonize(void) } break; } + /* If we get here - the child exited with some error status */ - exit(status); + if (WIFSIGNALLED(status)) + exit(128 + WTERMSIG(status)); + else + exit(WEXITSTATUS(status)); } signal( SIGTERM, SIG_DFL ); |