aboutsummaryrefslogtreecommitdiffstats
path: root/testing/dcron/pidfile.patch
blob: 28a0e27fa1495eba84502e5a61f050aebd0dcc6f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
diff -upr dcron-4.5.orig/Makefile dcron-4.5/Makefile
--- dcron-4.5.orig/Makefile	2016-03-20 00:03:45.043674778 +0100
+++ dcron-4.5/Makefile	2016-03-20 00:04:01.640164147 +0100
@@ -39,7 +39,7 @@ DEFS =  -DVERSION='"$(VERSION)"' \
 		-DTIMESTAMP_FMT='"$(TIMESTAMP_FMT)"'
 
 # save variables needed for `make install` in config
-all: $(PROTOS) crond crontab ;
+all: crond crontab ;
 	rm -f config
 	echo "PREFIX = $(PREFIX)" >> config
 	echo "SBINDIR = $(SBINDIR)" >> config
Only in dcron-4.5: Makefile.orig
diff -upr dcron-4.5.orig/main.c dcron-4.5/main.c
--- dcron-4.5.orig/main.c	2016-03-20 00:03:45.043674778 +0100
+++ dcron-4.5/main.c	2016-03-20 00:04:14.933355472 +0100
@@ -226,6 +226,11 @@ main(int ac, char **av)
 			exit(1);
 		} else if (pid > 0) {
 			/* parent */
+			FILE *fp;
+			if ((fp = fopen("/var/run/dcron.pid", "w")) != NULL) {
+				fprintf(fp, "%d\n", pid);
+				fclose(fp);
+			}
 			exit(0);
 		}
 		/* child continues */
Only in dcron-4.5: main.c.orig