summaryrefslogtreecommitdiff
path: root/source3/client
diff options
context:
space:
mode:
authorMartin Pool <mbp@samba.org>2003-01-15 05:27:33 +0000
committerMartin Pool <mbp@samba.org>2003-01-15 05:27:33 +0000
commitec894b56953a48a3591f3a127c7459f95c9935e3 (patch)
tree8b71673f70f3f1e7b9a848906753e0eac11032af /source3/client
parent3710ea2223f51f15940b27dcb835035d9c16f0c6 (diff)
downloadsamba-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/client')
-rw-r--r--source3/client/smbmount.c6
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 );