summaryrefslogtreecommitdiff
path: root/source3/smbd/server.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2008-08-08 22:34:59 +1000
committerMichael Adam <obnox@samba.org>2008-08-13 11:54:12 +0200
commit416fa081ab9d0a5338a11924d7b85c8e159a5109 (patch)
tree7c9635eb74f0a4f7c233097ab3ae1985fa083efa /source3/smbd/server.c
parentb5f4373be5ac0de57dffd8721f41fa1ff1e96182 (diff)
downloadsamba-416fa081ab9d0a5338a11924d7b85c8e159a5109.tar.gz
samba-416fa081ab9d0a5338a11924d7b85c8e159a5109.tar.bz2
samba-416fa081ab9d0a5338a11924d7b85c8e159a5109.zip
ensure we exit with non-zero status on EOF on socket, so the parent
can trigger a brlock db cleanup (This used to be commit bbd49f9e1c4b50c4a596fb991f3306e1e90c0177)
Diffstat (limited to 'source3/smbd/server.c')
-rw-r--r--source3/smbd/server.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 265d4927f5..c7bf1daf68 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -296,7 +296,7 @@ static void remove_child_pid(pid_t pid, bool unclean_shutdown)
/* a child terminated uncleanly so tickle all processes to see
if they can grab any of the pending locks
*/
- DEBUG(0,(__location__ " Unclean shutdown of pid %u\n", pid));
+ DEBUG(3,(__location__ " Unclean shutdown of pid %u\n", pid));
messaging_send_buf(smbd_messaging_context(), procid_self(),
MSG_SMB_BRL_VALIDATE, NULL, 0);
message_send_all(smbd_messaging_context(),
@@ -891,6 +891,7 @@ static void exit_server_common(enum server_exit_reason how,
const char *const reason)
{
static int firsttime=1;
+ bool had_open_conn;
if (!firsttime)
exit(0);
@@ -902,7 +903,7 @@ static void exit_server_common(enum server_exit_reason how,
(negprot_global_auth_context->free)(&negprot_global_auth_context);
}
- conn_close_all();
+ had_open_conn = conn_close_all();
invalidate_all_vuids();
@@ -952,7 +953,11 @@ static void exit_server_common(enum server_exit_reason how,
(reason ? reason : "normal exit")));
}
- exit(0);
+ if (had_open_conn) {
+ exit(1);
+ } else {
+ exit(0);
+ }
}
void exit_server(const char *const explanation)