X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fmisc.cpp;h=ab61d9f1fe0f38058917de552b6d8bfc3b0deb19;hb=3772879ebdf452eeb9e8e2c04c07338c4933a3ed;hp=a299f0e54b6f1f36c05d338d8c5397eef36495e8;hpb=05aafad32a76aa43b95f0e1141027d0ebfc1b07e;p=builder.git diff --git a/source/misc.cpp b/source/misc.cpp index a299f0e..ab61d9f 100644 --- a/source/misc.cpp +++ b/source/misc.cpp @@ -7,6 +7,7 @@ Distributed under the LGPL #include #include +#include #include #include #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);