From ec894b56953a48a3591f3a127c7459f95c9935e3 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Wed, 15 Jan 2003 05:27:33 +0000 Subject: 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) --- source3/client/smbmount.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source3/client') 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 ); -- cgit