summaryrefslogtreecommitdiffstats
path: root/usr.sbin/cron/lib/compat.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/lib/compat.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/lib/compat.c')
-rw-r--r--usr.sbin/cron/lib/compat.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/cron/lib/compat.c b/usr.sbin/cron/lib/compat.c
index 6057b86..9686012 100644
--- a/usr.sbin/cron/lib/compat.c
+++ b/usr.sbin/cron/lib/compat.c
@@ -32,6 +32,7 @@ static char rcsid[] = "$FreeBSD$";
# include <sys/ioctl.h>
#endif
#include <errno.h>
+#include <paths.h>
/* the code does not depend on any of vfork's
@@ -109,7 +110,7 @@ setsid()
# else
newpgrp = setpgrp(0, getpid());
# endif
- if ((fd = open("/dev/tty", 2)) >= 0)
+ if ((fd = open(_PATH_TTY, 2)) >= 0)
{
(void) ioctl(fd, TIOCNOTTY, (char*)0);
(void) close(fd);
@@ -117,9 +118,9 @@ setsid()
# else /*BSD*/
newpgrp = setpgrp();
- (void) close(STDIN); (void) open("/dev/null", 0);
- (void) close(STDOUT); (void) open("/dev/null", 1);
- (void) close(STDERR); (void) open("/dev/null", 2);
+ (void) close(STDIN); (void) open(_PATH_DEVNULL, 0);
+ (void) close(STDOUT); (void) open(_PATH_DEVNULL, 1);
+ (void) close(STDERR); (void) open(_PATH_DEVNULL, 2);
# endif /*BSD*/
return newpgrp;
}
OpenPOWER on IntegriCloud