From fcfaebda7fb35989e62bc317287896c410c7833b Mon Sep 17 00:00:00 2001 From: David O'Neill Date: Thu, 25 Jan 2001 16:36:42 +0000 Subject: Changes from APPLIANCE_HEAD: source/smbd/server.c source/nmbd/nmbd.c - Fixed a very subtle bug with signals. Seems that POSIX requires that the signal mask be inhereted. So, if you happen to kick off smbd/nmbd from code that has the mask set on SIGUSR1, you lose messages. (This used to be commit b4c98196fc65e8b3bce928296e854987622eae78) --- source3/nmbd/nmbd.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/nmbd/nmbd.c') diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c index 5b9a00aad0..f772788341 100644 --- a/source3/nmbd/nmbd.c +++ b/source3/nmbd/nmbd.c @@ -686,6 +686,12 @@ static void usage(char *pname) fault_setup((void (*)(void *))fault_continue ); + /* POSIX demands that signals are inherited. If the invoking process has + * these signals masked, we will have problems, as we won't recieve them. */ + BlockSignals(False, SIGHUP); + BlockSignals(False, SIGUSR1); + BlockSignals(False, SIGTERM); + CatchSignal( SIGHUP, SIGNAL_CAST sig_hup ); CatchSignal( SIGTERM, SIGNAL_CAST sig_term ); -- cgit