diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2003-03-10 15:27:18 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2003-03-10 15:27:18 +0000 |
commit | 2dc13aa46d1530f4d4e87d647b30cc017f2776a5 (patch) | |
tree | e38aea4980b66d476496c50dfb5f6c6814dc38b7 /usr.sbin/cron/cron.c | |
parent | d8727b51b803bb44055be41fb1ff00180246b7bc (diff) |
Log that cron started up after we detach from the controlling terminal
and dup fds to /dev/null, not before. This may fix a possible race
when cron is started as the last thing in /etc/rc.
Diffstat (limited to 'usr.sbin/cron/cron.c')
-rw-r--r-- | usr.sbin/cron/cron.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/cron/cron.c b/usr.sbin/cron/cron.c index 47ef4dc5f2f..6e153ba756b 100644 --- a/usr.sbin/cron/cron.c +++ b/usr.sbin/cron/cron.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cron.c,v 1.31 2003/02/20 20:38:08 millert Exp $ */ +/* $OpenBSD: cron.c,v 1.32 2003/03/10 15:27:17 millert Exp $ */ /* Copyright 1988,1990,1993,1994 by Paul Vixie * All rights reserved @@ -22,7 +22,7 @@ */ #if !defined(lint) && !defined(LINT) -static const char rcsid[] = "$OpenBSD: cron.c,v 1.31 2003/02/20 20:38:08 millert Exp $"; +static const char rcsid[] = "$OpenBSD: cron.c,v 1.32 2003/03/10 15:27:17 millert Exp $"; #endif #define MAIN_PROGRAM @@ -117,7 +117,6 @@ main(int argc, char *argv[]) { break; case 0: /* child process */ - log_it("CRON",getpid(),"STARTUP",CRON_VERSION); (void) setsid(); if ((fd = open(_PATH_DEVNULL, O_RDWR, 0)) >= 0) { (void) dup2(fd, STDIN); @@ -126,6 +125,7 @@ main(int argc, char *argv[]) { if (fd != STDERR) (void) close(fd); } + log_it("CRON",getpid(),"STARTUP",CRON_VERSION); break; default: /* parent process should just die */ |