minor async DNS cleanups
authorAndrew Tridgell <tridge@samba.org>
Sat, 1 Nov 1997 23:42:28 +0000 (23:42 +0000)
committerAndrew Tridgell <tridge@samba.org>
Sat, 1 Nov 1997 23:42:28 +0000 (23:42 +0000)
- start it earlier
- set DEBUGLEVEL to -1 to prevent any debug calls in child
- exit with _exit() to prevent logfile corruption
(This used to be commit 21dd073a2003fa4707c1577a6b07bcef30eb6a50)

source3/nmbd/asyncdns.c
source3/nmbd/nmbd.c

index 94fd65b147a40c80550745951b079276b803c23a..4982f7f340fbbe239e03653f51edae75da7339b0 100644 (file)
@@ -89,7 +89,7 @@ static void asyncdns_process(void)
        struct query_record r;
        fstring qname;
 
-       DEBUGLEVEL = 0;
+       DEBUGLEVEL = -1;
 
        while (1) {
                if (read_data(fd_in, (char *)&r, sizeof(r)) != sizeof(r)) 
@@ -103,7 +103,7 @@ static void asyncdns_process(void)
                        break;
        }
 
-       exit(0);
+       _exit(0);
 }
 
 
@@ -127,7 +127,6 @@ void start_async_dns(void)
                fd_out = fd2[1];
                close(fd1[1]);
                close(fd2[0]);
-               DEBUG(3,("async DNS initialised\n"));
                return;
        }
 
index d53ec8c2e0c03a83378d02017fef9471e454181a..696889c4844a4932e8bcb81ec66ad5251007a956 100644 (file)
@@ -561,6 +561,10 @@ static void usage(char *pname)
     return -1;
   }
 
+#ifndef SYNC_DNS
+  start_async_dns();
+#endif
+
   if (!reload_services(False))
     return(-1);        
 
@@ -590,10 +594,6 @@ static void usage(char *pname)
     become_daemon();
   }
 
-#ifndef SYNC_DNS
-  start_async_dns();
-#endif
-
   if (*pidFile)
     {
       int     fd;