From: Roy Marples Date: Fri, 30 Apr 2010 03:02:30 +0000 (+0000) Subject: log the pid when forking to background. X-Git-Tag: v5.2.3~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c61490884bbfe95ce113260f647634758d80deff;p=thirdparty%2Fdhcpcd.git log the pid when forking to background. 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. --- diff --git a/bind.c b/bind.c index 9e79ceaa..2987f9c8 100644 --- 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;