summaryrefslogtreecommitdiff
path: root/source3/nmbd/nmbd.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/nmbd/nmbd.c')
-rw-r--r--source3/nmbd/nmbd.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c
index 914f288001..5b9a00aad0 100644
--- a/source3/nmbd/nmbd.c
+++ b/source3/nmbd/nmbd.c
@@ -186,7 +186,7 @@ static void expire_names_and_servers(time_t t)
/************************************************************************** **
reload the list of network interfaces
************************************************************************** */
-static void reload_interfaces(time_t t)
+static BOOL reload_interfaces(time_t t)
{
static time_t lastt;
int n;
@@ -194,10 +194,10 @@ static void reload_interfaces(time_t t)
extern BOOL rescan_listen_set;
extern struct in_addr loopback_ip;
- if (t && ((t - lastt) < NMBD_INTERFACES_RELOAD)) return;
+ if (t && ((t - lastt) < NMBD_INTERFACES_RELOAD)) return False;
lastt = t;
- if (!interfaces_changed()) return;
+ if (!interfaces_changed()) return False;
/* the list of probed interfaces has changed, we may need to add/remove
some subnets */
@@ -253,6 +253,13 @@ static void reload_interfaces(time_t t)
}
rescan_listen_set = True;
+
+ /* We need to shutdown if there are no subnets... */
+ if (FIRST_SUBNET == NULL) {
+ DEBUG(0,("reload_interfaces: No subnets to listen to. Shutting down...\n"));
+ return True;
+ }
+ return False;
}
@@ -484,12 +491,14 @@ static void process(void)
if(reload_after_sighup) {
reload_nmbd_services( True );
reopen_logs();
- reload_interfaces(0);
+ if(reload_interfaces(0))
+ return;
reload_after_sighup = False;
}
/* check for new network interfaces */
- reload_interfaces(t);
+ if(reload_interfaces(t))
+ return;
/* free up temp memory */
lp_talloc_free();
@@ -685,6 +694,11 @@ static void usage(char *pname)
BlockSignals(True,SIGFPE);
#endif
+ /* We no longer use USR2... */
+#if defined(SIGUSR2)
+ BlockSignals(True, SIGUSR2);
+#endif
+
while( EOF !=
(opt = getopt( argc, argv, "Vaos:T:I:C:bAB:N:Rn:l:d:Dp:hSH:G:f:" )) )
{