From 3e0c6ded6538899cbdf1f4c30669d411e07ac957 Mon Sep 17 00:00:00 2001 From: Jean-François Micouleau Date: Fri, 29 Mar 2002 13:58:32 +0000 Subject: nmbd handle shutdown message. J.F. (This used to be commit c33459f7018a2522158b20261ab8c100fdde9034) --- source3/nmbd/nmbd.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source3/nmbd') diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c index 62e3f1757b..051991f46d 100644 --- a/source3/nmbd/nmbd.c +++ b/source3/nmbd/nmbd.c @@ -65,6 +65,15 @@ static void terminate(void) exit(0); } +/**************************************************************************** ** + Handle a SHUTDOWN message from smbcontrol. + **************************************************************************** */ + +static void nmbd_terminate(int msg_type, pid_t src, void *buf, size_t len) +{ + terminate(); +} + /**************************************************************************** ** Catch a SIGTERM signal. **************************************************************************** */ @@ -857,6 +866,7 @@ static void usage(char *pname) message_init(); message_register(MSG_FORCE_ELECTION, nmbd_message_election); message_register(MSG_WINS_NEW_ENTRY, nmbd_wins_new_entry); + message_register(MSG_SHUTDOWN, nmbd_terminate); DEBUG( 3, ( "Opening sockets %d\n", global_nmb_port ) ); -- cgit