aboutsummaryrefslogtreecommitdiff
path: root/bin/sh/input.c
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2004-01-21 12:50:01 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2004-01-21 12:50:01 +0000
commit7e1c72660f308aa7a5d708da6825a5eb6e182ed1 (patch)
tree45b894f449c0d20308caae0992208804c1312206 /bin/sh/input.c
parent0193eb5ee905fe6a653925bfc5357848bba2c949 (diff)
downloadsrc-7e1c72660f308aa7a5d708da6825a5eb6e182ed1.tar.gz
src-7e1c72660f308aa7a5d708da6825a5eb6e182ed1.zip
Replace home-grown dup2() implementation with actual dup2() calls. This
should slightly reduce the number of system calls in critical portions of the shell, and select a more efficient path through the fdalloc code. Reviewed by: bde
Notes
Notes: svn path=/head/; revision=124780
Diffstat (limited to 'bin/sh/input.c')
-rw-r--r--bin/sh/input.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/sh/input.c b/bin/sh/input.c
index 85b94d6759ec..9948881bc088 100644
--- a/bin/sh/input.c
+++ b/bin/sh/input.c
@@ -388,7 +388,7 @@ setinputfile(char *fname, int push)
if ((fd = open(fname, O_RDONLY)) < 0)
error("Can't open %s: %s", fname, strerror(errno));
if (fd < 10) {
- fd2 = copyfd(fd, 10);
+ fd2 = fcntl(fd, F_DUPFD, 10);
close(fd);
if (fd2 < 0)
error("Out of file descriptors");