/[gentoo-x86]/sys-process/dcron/files/dcron-4.4-pidfile.patch
Gentoo

Contents of /sys-process/dcron/files/dcron-4.4-pidfile.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Tue Oct 26 07:07:10 2010 UTC (3 years, 10 months ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Version bump #318703 by Sebastian Pipping.

(Portage version: 2.2_rc96/cvs/Linux x86_64)

1 From 14b0f33ebf33d3d08427fd4d9fd4bda3cc107bd0 Mon Sep 17 00:00:00 2001
2 From: Mike Frysinger <vapier@gentoo.org>
3 Date: Tue, 26 Oct 2010 01:42:32 -0400
4 Subject: [PATCH] crond: write a pid file
5
6 Signed-off-by: Mike Frysinger <vapier@gentoo.org>
7 ---
8 Makefile | 2 +-
9 main.c | 5 +++++
10 2 files changed, 6 insertions(+), 1 deletions(-)
11
12 diff --git a/Makefile b/Makefile
13 index dc5b78f..e278312 100644
14 --- a/Makefile
15 +++ b/Makefile
16 @@ -38,7 +38,7 @@ DEFS = -DVERSION='"$(VERSION)"' \
17 -DTIMESTAMP_FMT='"$(TIMESTAMP_FMT)"'
18
19 # save variables needed for `make install` in config
20 -all: $(PROTOS) crond crontab ;
21 +all: crond crontab ;
22 rm -f config
23 echo "PREFIX = $(PREFIX)" >> config
24 echo "SBINDIR = $(SBINDIR)" >> config
25 diff --git a/main.c b/main.c
26 index e4a742e..6313213 100644
27 --- a/main.c
28 +++ b/main.c
29 @@ -227,6 +227,11 @@ main(int ac, char **av)
30 exit(1);
31 } else if (pid > 0) {
32 /* parent */
33 + FILE *fp;
34 + if ((fp = fopen("/var/run/cron.pid", "w")) != NULL) {
35 + fprintf(fp, "%d\n", pid);
36 + fclose(fp);
37 + }
38 exit(0);
39 }
40 /* child continues */
41 --
42 1.7.3.1

  ViewVC Help
Powered by ViewVC 1.1.20