Do not print daemon's pid after forking if a pidfile is used.

This commit is contained in:
Paul Lietar
2013-06-21 11:58:29 +10:00
committed by James Laird
parent b4e962f6ba
commit e9f5e8a078
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -60,7 +60,8 @@ void daemon_init() {
exit(1);
} else {
// Success !
printf("%d\n", pid);
if (!config.pidfile)
printf("%d\n", pid);
exit(0);
}
} else {
+1 -1
View File
@@ -88,7 +88,7 @@ void usage(char *progname) {
printf(" -b FILL set how full the buffer must be before audio output\n");
printf(" starts. This value is in frames; default %d\n", config.buffer_start_fill);
printf(" -d, --daemon fork (daemonise). The PID of the child process is\n");
printf(" written to stdout\n");
printf(" written to stdout, unless a pidfile is used.\n");
printf(" -P, --pidfile=FILE write daemon's pid to FILE on startup.\n");
printf(" Has no effect if -d is not specified\n");
printf(" -l, --log FILE redirect shairport's standard output to FILE\n");