nmbd: call reinit_after_fork() in all needed cases
authorStefan Metzmacher <metze@samba.org>
Tue, 15 Apr 2008 08:38:21 +0000 (10:38 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 18 Apr 2008 13:00:19 +0000 (15:00 +0200)
metze

source/nmbd/asyncdns.c
source/nmbd/nmbd.c

index 5e5565991eff955e7ca959208f4220e9ac8ac4bb..0329491c4a6b6529df24b00c9549b9229a9f12cb 100644 (file)
@@ -164,6 +164,11 @@ void start_async_dns(void)
        CatchSignal(SIGHUP, SIG_IGN);
         CatchSignal(SIGTERM, SIGNAL_CAST sig_term );
 
+       if (!reinit_after_fork(nmbd_messaging_context())) {
+               DEBUG(0,("reinit_after_fork() failed\n"));
+               smb_panic("reinit_after_fork() failed");
+       }
+
        asyncdns_process();
 }
 
index 01fdbbc5a46ad3f60d4295819d706d7a5d8046d9..e765fcb725d145cfe65820c645fb257d942cb36e 100644 (file)
@@ -901,6 +901,11 @@ static bool open_sockets(bool isdaemon, int port)
 
        pidfile_create("nmbd");
 
+       if (!reinit_after_fork(nmbd_messaging_context())) {
+               DEBUG(0,("reinit_after_fork() failed\n"));
+               exit(1);
+       }
+
        /* get broadcast messages */
        claim_connection(NULL,"",FLAG_MSG_GENERAL|FLAG_MSG_DBWRAP);