From 0f9ceedbc14ad04646ad55bdeddab1ccca79cf00 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Thu, 28 Dec 2006 18:29:45 +0000 Subject: [PATCH] Fixed pidfile handling --- citadel/sysdep.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/citadel/sysdep.c b/citadel/sysdep.c index e3bfde3d7..f679ad5be 100644 --- a/citadel/sysdep.c +++ b/citadel/sysdep.c @@ -777,11 +777,6 @@ void start_daemon(int unused) { child = fork(); if (child != 0) { - fp = fopen(file_pid_file, "w"); - if (fp != NULL) { - fprintf(fp, "%d\n", child); - fclose(fp); - } exit(0); } @@ -810,6 +805,11 @@ void start_daemon(int unused) { } else { + fp = fopen(file_pid_file, "w"); + if (fp != NULL) { + fprintf(fp, "%d\n", child); + fclose(fp); + } waitpid(current_child, &status, 0); } -- 2.39.2