File fix-crash-as-nobody.diff of Package mt-daapd

--- src/main.c
+++ src/main.c	2005/02/09 07:55:20
@@ -826,13 +826,15 @@
     }
 
 
-    /* wait to for config.pid to be set by the signal handler */
-    while(!config.pid) {
-	sleep(1);
-    }
-
-    fprintf(pid_fp,"%d\n",config.pid);
-    fclose(pid_fp);
+    if((!foreground) && (!force_non_root)) {
+        /* wait to for config.pid to be set by the signal handler */
+        while(!config.pid) {
+            sleep(1);
+        }
+
+        fprintf(pid_fp,"%d\n",config.pid);
+        fclose(pid_fp);
+    };
 
     DPRINTF(E_LOG,L_MAIN|L_PL,"Loading playlists\n");
 
openSUSE Build Service is sponsored by