]> git.tdb.fi Git - builder.git/blobdiff - source/misc.cpp
Add some output to get_package_source
[builder.git] / source / misc.cpp
index 0d7a13de81931dcfb2e5b7e82229d32c9711d5a7..ab61d9f1fe0f38058917de552b6d8bfc3b0deb19 100644 (file)
@@ -1,5 +1,15 @@
+/* $Id$
+
+This file is part of builder
+Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions
+Distributed under the LGPL
+*/
+
 #include <iostream>
 #include <sys/wait.h>
+#include <fcntl.h>
+#include <cstdlib>
+#include <cstring>
 #include "misc.h"
 
 using namespace std;
@@ -28,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);