]> git.tdb.fi Git - builder.git/blobdiff - source/misc.cpp
Add some output to get_package_source
[builder.git] / source / misc.cpp
index a299f0e54b6f1f36c05d338d8c5397eef36495e8..ab61d9f1fe0f38058917de552b6d8bfc3b0deb19 100644 (file)
@@ -7,6 +7,7 @@ Distributed under the LGPL
 
 #include <iostream>
 #include <sys/wait.h>
+#include <fcntl.h>
 #include <cstdlib>
 #include <cstring>
 #include "misc.h"
@@ -37,7 +38,10 @@ string run_command(const StringList &argv)
 
                close(pfd[0]);
                dup2(pfd[1], 1);
-               dup2(pfd[1], 2);
+               close(pfd[1]);
+               int devnull=open("/dev/null", O_WRONLY);
+               dup2(devnull, 2);
+               close(devnull);
 
                execvp(argv_[0], argv_);
                ::exit(1);