[SCM] Samba Shared Repository - branch v3-0-test updated -
release-3-0-28a-14-g106ef5b
Jeremy Allison
jra at samba.org
Thu Mar 27 21:23:58 GMT 2008
The branch, v3-0-test has been updated
via 106ef5ba82380e13bdaf5011a25653040cb481fc (commit)
from 36df2d4666be72fe9254fa3c1188816e7f49a68c (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-0-test
- Log -----------------------------------------------------------------
commit 106ef5ba82380e13bdaf5011a25653040cb481fc
Author: Jeremy Allison <jra at samba.org>
Date: Thu Mar 27 14:23:26 2008 -0700
Fix for termination problems when no interfaces found - bug #5267.
Jeremy.
-----------------------------------------------------------------------
Summary of changes:
source/nmbd/nmbd.c | 21 +++++++++++++++------
1 files changed, 15 insertions(+), 6 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source/nmbd/nmbd.c b/source/nmbd/nmbd.c
index 742c747..ce4173a 100644
--- a/source/nmbd/nmbd.c
+++ b/source/nmbd/nmbd.c
@@ -168,11 +168,12 @@ static void reload_interfaces(time_t t)
return;
}
+ try_again:
+
/* the list of probed interfaces has changed, we may need to add/remove
some subnets */
load_interfaces();
- try_again:
/* find any interfaces that need adding */
for (n=iface_count() - 1; n >= 0; n--) {
@@ -233,7 +234,6 @@ static void reload_interfaces(time_t t)
/* We need to wait if there are no subnets... */
if (FIRST_SUBNET == NULL) {
- void (*saved_handler)(int);
DEBUG(0,("reload_interfaces: "
"No subnets to listen to. Waiting..\n"));
@@ -243,18 +243,27 @@ static void reload_interfaces(time_t t)
* cause us to exit.
*/
- saved_handler = CatchSignal( SIGTERM, SIGNAL_CAST SIG_DFL );
+ BlockSignals(false, SIGTERM);
- while (iface_count() == 0) {
+ while (iface_count() == 0 && !got_sig_term) {
sleep(5);
load_interfaces();
}
/*
- * We got an interface, restore our normal term handler.
+ * Handle termination inband.
+ */
+
+ if (got_sig_term) {
+ got_sig_term = 0;
+ terminate();
+ }
+
+ /*
+ * We got an interface, go back to blocking term.
*/
- CatchSignal( SIGTERM, SIGNAL_CAST saved_handler );
+ BlockSignals(true, SIGTERM);
goto try_again;
}
}
--
Samba Shared Repository
More information about the samba-cvs
mailing list