From aef2c5d69956c72f8b0bd2285283e8879ed8603d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 24 Dec 1997 09:30:56 +0000 Subject: Added SIGUSR1/SIGUSR2 handling. Sending nmbd/smbd a SIGUSR1 will raise the debug level by one (capped at 10) sending a SIGUSR2 will lower it (lower limit at zero). Jeremy. (This used to be commit 6a3cb6f4b46129e4d799a24d34cdb9460ed8910f) --- source3/nmbd/nmbd_packets.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'source3/nmbd/nmbd_packets.c') diff --git a/source3/nmbd/nmbd_packets.c b/source3/nmbd/nmbd_packets.c index 4fb0543967..03bd3889fa 100644 --- a/source3/nmbd/nmbd_packets.c +++ b/source3/nmbd/nmbd_packets.c @@ -1650,10 +1650,27 @@ BOOL listen_for_packets(BOOL run_election) timeout.tv_sec = (run_election||num_response_packets) ? 1 : NMBD_SELECT_LOOP; timeout.tv_usec = 0; - /* We can only take term signals when we are in the select. */ + /* Prepare for the select - allow certain signals. */ + BlockSignals(False, SIGTERM); +#if defined(SIGUSR1) + BlockSignals(False, SIGUSR1); +#endif /* SIGUSR1 */ +#if defined(SIGUSR2) + BlockSignals(False, SIGUSR2); +#endif /* SIGUSR2 */ + selrtn = sys_select(&fds,&timeout); + + /* We can only take signals when we are in the select - block them again here. */ + BlockSignals(True, SIGTERM); +#if defined(SIGUSR1) + BlockSignals(True, SIGUSR1); +#endif /* SIGUSR1 */ +#if defined(SIGUSR2) + BlockSignals(True, SIGUSR2); +#endif /* SIGUSR2 */ if(selrtn > 0) { -- cgit