summaryrefslogtreecommitdiffhomepage
path: root/src/helper/slbt_archive_import.c
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2017-11-18 19:09:40 -0500
committermidipix <writeonce@midipix.org>2017-11-18 19:11:49 -0500
commitf4ed8e1224eb396f71a1c921ee2489a677deaa0d (patch)
tree4ade35982f200b79b5b05a07364e8d3dc1b5257f /src/helper/slbt_archive_import.c
parentec6d7a3ad901cf5447353bdee159c99336ac9c2d (diff)
downloadslibtool-f4ed8e1224eb396f71a1c921ee2489a677deaa0d.tar.bz2
slibtool-f4ed8e1224eb396f71a1c921ee2489a677deaa0d.tar.xz
process spawning and forking: use dup2, not dup, in the child process.
Diffstat (limited to 'src/helper/slbt_archive_import.c')
-rw-r--r--src/helper/slbt_archive_import.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/helper/slbt_archive_import.c b/src/helper/slbt_archive_import.c
index 0d3ea52..c45efa4 100644
--- a/src/helper/slbt_archive_import.c
+++ b/src/helper/slbt_archive_import.c
@@ -65,9 +65,8 @@ static void slbt_archive_import_child(
argv[2] = 0;
close(fd[1]);
- close(0);
- if (dup(fd[0]) == 0)
+ if (dup2(fd[0],0) == 0)
execvp(program,argv);
_exit(EXIT_FAILURE);