Patch from tilman2: Close PID-file
authorfatbob313 <martin@fatbob.nu>
Thu, 20 Jan 2011 08:25:34 +0000 (08:25 +0000)
committerfatbob313 <martin@fatbob.nu>
Thu, 20 Jan 2011 08:25:34 +0000 (08:25 +0000)
src/main.c

index 1b92f50797e931a0807de2ed5f91548844ec9304..8a0573ab41eaccdd7e2cb3345bbf0b2a85f3520a 100644 (file)
@@ -66,6 +66,7 @@ void lockfile(const char *pidfile)
                Log_fatal("Cannot open PID-file %s for writing", pidfile);
        snprintf(str,16,"%d\n", getpid());
        write(lfp, str, strlen(str)); /* record pid to lockfile */
+       close(lfp);
        Log_info("PID-file: %s", pidfile);
 }