summaryrefslogtreecommitdiff
path: root/usr.bin/xargs
diff options
context:
space:
mode:
authorMaxime Henrion <mux@FreeBSD.org>2003-03-28 16:22:54 +0000
committerMaxime Henrion <mux@FreeBSD.org>2003-03-28 16:22:54 +0000
commitcec1ba8c9c93d67c31edf8d9aef5aaaec7ddab28 (patch)
tree6862cf7b3b1353ae14a44af2b6645c1fabcdaefe /usr.bin/xargs
parenta54ec1d233be98c80573446792fce98d5a0889f5 (diff)
downloadsrc-test2-cec1ba8c9c93d67c31edf8d9aef5aaaec7ddab28.tar.gz
src-test2-cec1ba8c9c93d67c31edf8d9aef5aaaec7ddab28.zip
Notes
Diffstat (limited to 'usr.bin/xargs')
-rw-r--r--usr.bin/xargs/xargs.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/xargs/xargs.c b/usr.bin/xargs/xargs.c
index 5e6c2b4f0748..76aa5b78243a 100644
--- a/usr.bin/xargs/xargs.c
+++ b/usr.bin/xargs/xargs.c
@@ -526,10 +526,13 @@ exec:
case -1:
err(1, "vfork");
case 0:
+ close(0);
if (oflag) {
- close(0);
if (open("/dev/tty", O_RDONLY) == -1)
- err(1, "open");
+ err(1, "open /dev/tty");
+ } else {
+ if (open("/dev/null", O_RDONLY) == -1)
+ err(1, "open /dev/null");
}
execvp(argv[0], argv);
childerr = errno;