summaryrefslogtreecommitdiff
blob: 9ef687746909cfe207c84e9211d3f2e5ffcd4cad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
write out a pidfile

--- dcron/main.c
+++ dcron/main.c
@@ -120,8 +120,14 @@
             perror("fork");
             exit(1);
         }
-        if (pid > 0)
+        if (pid > 0) {
+            FILE *fp;
+            if ((fp = fopen("/var/run/cron.pid", "w")) != NULL) {
+                fprintf(fp, "%d\n", pid);
+                fclose(fp);
+            }
             exit(0);
+        }
     }
 
     /*