summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2001-11-15 03:23:15 +0000
committerTim Potter <tpot@samba.org>2001-11-15 03:23:15 +0000
commit17ce9c52819ac2597684efa10475f5d0fb8fa206 (patch)
tree457cb46358af08b4f6ad07d8ff82ec964ea17617 /source3/nsswitch
parent5302dc12184481514e143f0b3cf4167c84a32ddd (diff)
downloadsamba-17ce9c52819ac2597684efa10475f5d0fb8fa206.tar.gz
samba-17ce9c52819ac2597684efa10475f5d0fb8fa206.tar.bz2
samba-17ce9c52819ac2597684efa10475f5d0fb8fa206.zip
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)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r--source3/nsswitch/winbindd.c22
1 files changed, 14 insertions, 8 deletions
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();