summaryrefslogtreecommitdiff
path: root/source/smbd/process.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-03-14 02:15:08 +0000
committerJeremy Allison <jra@samba.org>2002-03-14 02:15:08 +0000
commitcad82926a8baf7605cef81f0e0d4daa8e527e6ee (patch)
treeee3a67f31afcadf8e759d4b793dcd441e47808ea /source/smbd/process.c
parenta3cea5e9ae3b53ecbc45e61a39cbce0ca1b916aa (diff)
downloadsamba-cad82926a8baf7605cef81f0e0d4daa8e527e6ee.tar.gz
Now we have reliable signals take SIGTERM inband.
Jeremy.
Diffstat (limited to 'source/smbd/process.c')
-rw-r--r--source/smbd/process.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source/smbd/process.c b/source/smbd/process.c
index 8c037b47063..007621f6bb2 100644
--- a/source/smbd/process.c
+++ b/source/smbd/process.c
@@ -43,6 +43,7 @@ extern int global_oplock_break;
extern userdom_struct current_user_info;
extern int smb_read_error;
extern VOLATILE sig_atomic_t reload_after_sighup;
+extern VOLATILE sig_atomic_t got_sig_term;
extern BOOL global_machine_password_needs_changing;
extern fstring global_myworkgroup;
extern pstring global_myname;
@@ -104,9 +105,10 @@ BOOL push_oplock_pending_smb_message(char *buf, int msg_len)
}
/****************************************************************************
-do all async processing in here. This includes UDB oplock messages, kernel
-oplock messages, change notify events etc.
+ Do all async processing in here. This includes UDB oplock messages, kernel
+ oplock messages, change notify events etc.
****************************************************************************/
+
static void async_processing(fd_set *fds, char *buffer, int buffer_len)
{
/* check for oplock messages (both UDP and kernel) */
@@ -114,6 +116,10 @@ static void async_processing(fd_set *fds, char *buffer, int buffer_len)
process_local_message(buffer, buffer_len);
}
+ if (got_sig_term) {
+ exit_server("Caught TERM signal");
+ }
+
/* check for async change notify events */
process_pending_change_notify_queue(0);
@@ -122,7 +128,7 @@ static void async_processing(fd_set *fds, char *buffer, int buffer_len)
change_to_root_user();
DEBUG(1,("Reloading services after SIGHUP\n"));
reload_services(False);
- reload_after_sighup = False;
+ reload_after_sighup = 0;
}
}