summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-process/dcron/files/dcron-2.9-pidfile.patch')
-rw-r--r--sys-process/dcron/files/dcron-2.9-pidfile.patch20
1 files changed, 20 insertions, 0 deletions
diff --git a/sys-process/dcron/files/dcron-2.9-pidfile.patch b/sys-process/dcron/files/dcron-2.9-pidfile.patch
new file mode 100644
index 000000000000..61b009f399ae
--- /dev/null
+++ b/sys-process/dcron/files/dcron-2.9-pidfile.patch
@@ -0,0 +1,20 @@
+--- dcron/main.c.orig 2005-02-19 15:19:13.000000000 -0500
++++ dcron/main.c 2005-02-19 15:27:28.000000000 -0500
+@@ -122,8 +122,15 @@
+ perror("fork");
+ exit(1);
+ }
+- if (pid > 0)
+- exit(0);
++ if (pid > 0) {
++ int fdpid;
++ char pidstr[24];
++ fdpid = open("/var/run/cron.pid", O_WRONLY|O_CREAT|O_TRUNC, 0664);
++ sprintf(pidstr, "%d\n", pid);
++ write(fdpid, pidstr, strlen(pidstr));
++ close(fdpid);
++ exit(0);
++ }
+ }
+
+ /*