summaryrefslogtreecommitdiffstats
path: root/usr.sbin/cron/cron/popen.c
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2000-12-09 09:35:55 +0000
committerobrien <obrien@FreeBSD.org>2000-12-09 09:35:55 +0000
commitc2ee1dcc02035d781d6c70f06df7106979a9f870 (patch)
tree757810dc1fdd19be4c8125ccb9e8beb1aff3d929 /usr.sbin/cron/cron/popen.c
parentc174181f432119d1dae3f5e58ecc14c8d7b6f545 (diff)
downloadFreeBSD-src-c2ee1dcc02035d781d6c70f06df7106979a9f870.zip
FreeBSD-src-c2ee1dcc02035d781d6c70f06df7106979a9f870.tar.gz
Add `_PATH_DEVZERO'.
Use _PATH_* where where possible.
Diffstat (limited to 'usr.sbin/cron/cron/popen.c')
-rw-r--r--usr.sbin/cron/cron/popen.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/cron/cron/popen.c b/usr.sbin/cron/cron/popen.c
index 1ac775d..f22f421 100644
--- a/usr.sbin/cron/cron/popen.c
+++ b/usr.sbin/cron/cron/popen.c
@@ -34,6 +34,7 @@ static const char rcsid[] =
#include "cron.h"
#include <sys/signal.h>
#include <fcntl.h>
+#include <paths.h>
#if defined(SYSLOG)
# include <syslog.h>
#endif
@@ -130,7 +131,7 @@ cron_popen(program, type, e)
if (*type == 'r') {
/* Do not share our parent's stdin */
(void)close(0);
- (void)open("/dev/null", O_RDWR);
+ (void)open(_PATH_DEVNULL, O_RDWR);
if (pdes[1] != 1) {
dup2(pdes[1], 1);
dup2(pdes[1], 2); /* stderr, too! */
@@ -144,9 +145,9 @@ cron_popen(program, type, e)
}
/* Hack: stdout gets revoked */
(void)close(1);
- (void)open("/dev/null", O_RDWR);
+ (void)open(_PATH_DEVNULL, O_RDWR);
(void)close(2);
- (void)open("/dev/null", O_RDWR);
+ (void)open(_PATH_DEVNULL, O_RDWR);
(void)close(pdes[1]);
}
# if defined(LOGIN_CAP)
OpenPOWER on IntegriCloud