summaryrefslogtreecommitdiffstats
path: root/bin/sh/jobs.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 /bin/sh/jobs.c
parentc174181f432119d1dae3f5e58ecc14c8d7b6f545 (diff)
downloadFreeBSD-src-c2ee1dcc02035d781d6c70f06df7106979a9f870.zip
FreeBSD-src-c2ee1dcc02035d781d6c70f06df7106979a9f870.tar.gz
Add `_PATH_DEVZERO'.
Use _PATH_* where where possible.
Diffstat (limited to 'bin/sh/jobs.c')
-rw-r--r--bin/sh/jobs.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/bin/sh/jobs.c b/bin/sh/jobs.c
index e437441..8ba307b 100644
--- a/bin/sh/jobs.c
+++ b/bin/sh/jobs.c
@@ -52,6 +52,7 @@ static const char rcsid[] =
#include <sys/wait.h>
#include <sys/time.h>
#include <sys/resource.h>
+#include <paths.h>
#endif
#include <sys/ioctl.h>
@@ -635,9 +636,9 @@ forkshell(jp, n, mode)
if ((jp == NULL || jp->nprocs == 0) &&
! fd0_redirected_p ()) {
close(0);
- if (open("/dev/null", O_RDONLY) != 0)
- error("Can't open /dev/null: %s",
- strerror(errno));
+ if (open(_PATH_DEVNULL, O_RDONLY) != 0)
+ error("Can't open %s: %s",
+ _PATH_DEVNULL, strerror(errno));
}
}
#else
@@ -647,9 +648,9 @@ forkshell(jp, n, mode)
if ((jp == NULL || jp->nprocs == 0) &&
! fd0_redirected_p ()) {
close(0);
- if (open("/dev/null", O_RDONLY) != 0)
- error("Can't open /dev/null: %s",
- strerror(errno));
+ if (open(_PATH_DEVNULL, O_RDONLY) != 0)
+ error("Can't open %s: %s",
+ _PATH_DEVNULL, strerror(errno));
}
}
#endif
OpenPOWER on IntegriCloud