]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
log the pid when forking to background.
authorRoy Marples <roy@marples.name>
Fri, 30 Apr 2010 03:02:30 +0000 (03:02 +0000)
committerRoy Marples <roy@marples.name>
Fri, 30 Apr 2010 03:02:30 +0000 (03:02 +0000)
mark the log entry before forking as LOG_DEBUG as we usually don't have problems
here and don't want to log twice with LOG_INFO.

Thanks to Gerd von Egidy.

bind.c

diff --git a/bind.c b/bind.c
index 9e79ceaa82470ac443ee0fdd0606fa99bbc45401..2987f9c8024451db1e507d9b40b0dd1047cc034c 100644 (file)
--- a/bind.c
+++ b/bind.c
@@ -73,7 +73,7 @@ daemonise(void)
                syslog(LOG_ERR, "pipe: %m");
                return -1;
        }
-       syslog(LOG_INFO, "forking to background");
+       syslog(LOG_DEBUG, "forking to background");
        switch (pid = fork()) {
        case -1:
                syslog(LOG_ERR, "fork: %m");
@@ -105,6 +105,7 @@ daemonise(void)
        }
        /* Done with the fd now */
        if (pid != 0) {
+               syslog(LOG_INFO, "forked to background, child pid %d",pid);
                writepid(pidfd, pid);
                close(pidfd);
                pidfd = -1;