diff options
| author | 2001-10-24 17:28:16 +0000 | |
|---|---|---|
| committer | 2001-10-24 17:28:16 +0000 | |
| commit | 14852038eded5e16ae6dfd1e43d39de403fd0497 (patch) | |
| tree | 32df7c8c549de0542e25efc8c18c808250d39a49 /usr.sbin/cron/crontab.c | |
| parent | cleanup, such as spaces and dangling return;s (diff) | |
| download | wireguard-openbsd-14852038eded5e16ae6dfd1e43d39de403fd0497.tar.xz wireguard-openbsd-14852038eded5e16ae6dfd1e43d39de403fd0497.zip | |
When becoming a daemon, dup stdin, stdout, and stderr to /dev/null
Change an unsafe vfork() to fork()
Fix dup2() usage--must check for oldd == newd case and no need to close oldd
Fixes annoying messages from sendmail about stdout being closed.
Diffstat (limited to 'usr.sbin/cron/crontab.c')
| -rw-r--r-- | usr.sbin/cron/crontab.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/cron/crontab.c b/usr.sbin/cron/crontab.c index fee68e0670a..e3cc15b630a 100644 --- a/usr.sbin/cron/crontab.c +++ b/usr.sbin/cron/crontab.c @@ -1,4 +1,4 @@ -/* $OpenBSD: crontab.c,v 1.22 2001/08/19 18:30:38 millert Exp $ */ +/* $OpenBSD: crontab.c,v 1.23 2001/10/24 17:28:16 millert Exp $ */ /* Copyright 1988,1990,1993,1994 by Paul Vixie * All rights reserved */ @@ -21,7 +21,7 @@ */ #if !defined(lint) && !defined(LINT) -static char rcsid[] = "$OpenBSD: crontab.c,v 1.22 2001/08/19 18:30:38 millert Exp $"; +static char rcsid[] = "$OpenBSD: crontab.c,v 1.23 2001/10/24 17:28:16 millert Exp $"; #endif /* crontab - install and manage per-user crontab files @@ -303,8 +303,8 @@ edit_cmd(void) { } fprintf(stderr, "no crontab for %s - using an empty one\n", User); - if (!(f = fopen("/dev/null", "r"))) { - perror("/dev/null"); + if (!(f = fopen(_PATH_DEVNULL, "r"))) { + perror(_PATH_DEVNULL); exit(ERROR_EXIT); } } |
