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.
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");
}
/* 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;