summaryrefslogtreecommitdiff
path: root/usr.bin/xargs/xargs.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2003-06-13 16:54:01 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2003-06-13 16:54:01 +0000
commitf1296aaa5c456cdb50bd2fc8a01ba8920c9e5547 (patch)
tree5f8d65233e03616f465198ab78185e5369a1f8b3 /usr.bin/xargs/xargs.c
parent57776938a6049616a5db902a2be841c1575c4fb4 (diff)
Close correct fd after dup2(); Maxime Henrion
Diffstat (limited to 'usr.bin/xargs/xargs.c')
-rw-r--r--usr.bin/xargs/xargs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/xargs/xargs.c b/usr.bin/xargs/xargs.c
index 0c46d805c08..d63f742aeab 100644
--- a/usr.bin/xargs/xargs.c
+++ b/usr.bin/xargs/xargs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xargs.c,v 1.15 2003/06/12 01:15:53 millert Exp $ */
+/* $OpenBSD: xargs.c,v 1.16 2003/06/13 16:54:00 millert Exp $ */
/* $FreeBSD: xargs.c,v 1.51 2003/05/03 19:09:11 obrien Exp $ */
/*-
@@ -45,7 +45,7 @@ static const char copyright[] =
#if 0
static const char sccsid[] = "@(#)xargs.c 8.1 (Berkeley) 6/6/93";
#else
-static const char rcsid[] = "$OpenBSD: xargs.c,v 1.15 2003/06/12 01:15:53 millert Exp $";
+static const char rcsid[] = "$OpenBSD: xargs.c,v 1.16 2003/06/13 16:54:00 millert Exp $";
#endif
#endif /* not lint */
@@ -531,7 +531,7 @@ exec:
if (fd > STDIN_FILENO) {
if (dup2(fd, STDIN_FILENO) != 0)
err(1, "can't dup2 to stdin");
- close(STDIN_FILENO);
+ close(fd);
}
execvp(argv[0], argv);
childerr = errno;