From 9b6d39d4478dad091684ca4949a5cdc7ddbdd2d2 Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Mon, 24 Jan 2005 07:42:42 +0000 Subject: [PATCH] Fix typo in usage, dont write pidfile unless running as root --- src/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.c b/src/main.c index f13d7676..08be2a17 100644 --- a/src/main.c +++ b/src/main.c @@ -543,10 +543,10 @@ void usage(char *program) { printf(" -d Debuglevel (0-9)\n"); printf(" -D Debug modules\n"); printf(" -m Disable mDNS\n"); - printf(" -c Use configfile specified"); + printf(" -c Use configfile specified\n"); printf(" -p Parse playlist file\n"); printf(" -f Run in foreground\n"); - printf(" -y Yes, go ahead and run as non-root user"); + printf(" -y Yes, go ahead and run as non-root user\n"); printf("\n\n"); printf("Valid debug modules:\n"); printf(" config,webserver,database,scan,query,index,browse\n"); @@ -795,7 +795,7 @@ int main(int argc, char *argv[]) { #endif /* open the pidfile, so it can be written once we detach */ - if(!foreground) { + if((!foreground) && (!force_non_root)) { if(-1 == (pid_fd = open(PIDFILE,O_CREAT | O_WRONLY | O_TRUNC, 0644))) DPRINTF(E_FATAL,L_MAIN,"Error opening pidfile (%s): %s\n",PIDFILE,strerror(errno));