From 17ce9c52819ac2597684efa10475f5d0fb8fa206 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Thu, 15 Nov 2001 03:23:15 +0000 Subject: Bit of a cleanup of signal handling code. Ignore the SIGUSR1 signal before we install a handler for it as glibc (?) seems to just print out "User defined signal 1" and exit if no handler is installed. (This used to be commit 1212591095dfe65b5e708bee32be5d57b9f33bc8) --- source3/nsswitch/winbindd.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'source3') diff --git a/source3/nsswitch/winbindd.c b/source3/nsswitch/winbindd.c index 0d13b70442..7a88711e79 100644 --- a/source3/nsswitch/winbindd.c +++ b/source3/nsswitch/winbindd.c @@ -77,7 +77,7 @@ static void winbindd_status(void) /* Print winbindd status to log file */ -static void do_print_winbindd_status(void) +static void print_winbindd_status(void) { winbindd_status(); winbindd_idmap_status(); @@ -87,7 +87,7 @@ static void do_print_winbindd_status(void) /* Flush client cache */ -static void do_flush_caches(void) +static void flush_caches(void) { /* Clear cached user and group enumation info */ @@ -114,11 +114,11 @@ static void termination_handler(int signum) do_sigterm = True; } -static BOOL print_winbindd_status; +static BOOL do_sigusr1; static void sigusr1_handler(int signum) { - print_winbindd_status = True; + do_sigusr1 = True; } static BOOL do_sighup; @@ -657,15 +657,16 @@ static void process_loop(int accept_sock) /* Flush winbindd cache */ - do_flush_caches(); + flush_caches(); reload_services_file(True); do_sighup = False; } - if (print_winbindd_status) { - do_print_winbindd_status(); - print_winbindd_status = False; + if (do_sigusr1) { + print_winbindd_status(); + + do_sigusr1 = False; } } } @@ -682,6 +683,11 @@ int main(int argc, char **argv) BOOL interactive = False; int opt, new_debuglevel = -1; + /* glibc (?) likes to print "User defined signal 1" and exit if a + SIGUSR1 is received before a handler is installed */ + + CatchSignal(SIGUSR1, SIG_IGN); + /* Initialise for running in non-root mode */ sec_init(); -- cgit