Now citadel.pid contains the pid of the watcher process in case
authorDave West <davew@uncensored.citadel.org>
Tue, 15 Jan 2008 15:19:09 +0000 (15:19 +0000)
committerDave West <davew@uncensored.citadel.org>
Tue, 15 Jan 2008 15:19:09 +0000 (15:19 +0000)
something wants to stop us via the pid file.

citadel/sysdep.c

index 92308d948e3813f4f64a53d8358c4d8042546b96..0cbfec52798229323476923ed2c23b9327a91964 100644 (file)
@@ -887,11 +887,7 @@ void start_daemon(int unused) {
                else {
                        fp = fopen(file_pid_file, "w");
                        if (fp != NULL) {
-               /*
-                * NB.. The pid file contains the pid of the actual server.
-                * This is not the pid of the watcher process
-                */
-                               fprintf(fp, ""F_PID_T"\n", current_child);
+                               fprintf(fp, ""F_PID_T"\n", getpid());
                                fclose(fp);
                        }
                        waitpid(current_child, &status, 0);