Renamed "internal.h" to the more sensible "busybox.h".
[oweals/busybox.git] / syslogd.c
index 508a6572b49379dd79779a05580cec5950b1de39..9bedc84f29a7cd71145865f86027b23d9025bc2a 100644 (file)
--- a/syslogd.c
+++ b/syslogd.c
@@ -23,7 +23,7 @@
  *
  */
 
-#include "internal.h"
+#include "busybox.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <ctype.h>
@@ -36,7 +36,6 @@
 #include <time.h>
 #include <unistd.h>
 #include <sys/socket.h>
-#include <sys/stat.h>
 #include <sys/types.h>
 #include <sys/un.h>
 #include <sys/param.h>
@@ -302,14 +301,17 @@ static void doSyslogd (void)
        signal (SIGTERM, quit_signal);
        signal (SIGQUIT, quit_signal);
        signal (SIGHUP,  SIG_IGN);
+       signal (SIGCHLD,  SIG_IGN);
+#ifdef SIGCLD
        signal (SIGCLD,  SIG_IGN);
+#endif
        signal (SIGALRM, domark);
        alarm (MarkInterval);
 
        /* Create the syslog file so realpath() can work. */
        close (open (_PATH_LOG, O_RDWR | O_CREAT, 0644));
        if (realpath (_PATH_LOG, lfile) == NULL)
-               fatalError ("Could not resolv path to " _PATH_LOG ": %s\n", strerror (errno));
+               fatalError ("Could not resolve path to " _PATH_LOG ": %s\n", strerror (errno));
 
        unlink (lfile);
 
@@ -372,8 +374,11 @@ static void doSyslogd (void)
                                                continue;
                                        }
 
-                                       if (pid == 0)
+                                       if (pid == 0) {
                                                serveConnection (conn);
+                                               close (conn);
+                                               exit( TRUE);
+                                       }
                                        close (conn);
                                }
                        }