The pid file now contains a valid pid (it used to be 0).
[citadel.git] / citadel / sysdep.c
index 1d24919c7ac02c042629948a5701b2ffb664f3a5..55643e8c5eb0ab6b9b6495b5734e7209df0f2ce9 100644 (file)
@@ -854,7 +854,11 @@ void start_daemon(int unused) {
                else {
                        fp = fopen(file_pid_file, "w");
                        if (fp != NULL) {
-                               fprintf(fp, ""F_PID_T"\n", child);
+               /*
+                * 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);
                                fclose(fp);
                        }
                        waitpid(current_child, &status, 0);