summaryrefslogtreecommitdiff
path: root/usr.sbin/cron/cron.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2003-03-10 15:27:18 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2003-03-10 15:27:18 +0000
commit2dc13aa46d1530f4d4e87d647b30cc017f2776a5 (patch)
treee38aea4980b66d476496c50dfb5f6c6814dc38b7 /usr.sbin/cron/cron.c
parentd8727b51b803bb44055be41fb1ff00180246b7bc (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.c6
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 */