diff options
author | David Kalnischkies <kalnischkies@gmail.com> | 2012-04-19 11:05:41 +0200 |
---|---|---|
committer | David Kalnischkies <kalnischkies@gmail.com> | 2012-04-19 11:05:41 +0200 |
commit | 0b4895d3d223c97c6ba1ece9f7b88479debb7fb7 (patch) | |
tree | 709af179edbcfc8985f13e7f645af973b9ce53c1 /apt-pkg/contrib/fileutl.cc | |
parent | 04d24dbdcc2eabf616b26878084d3b8790e30086 (diff) |
* apt-pkg/contrib/fileutl.cc:
- redirect stderr from compressors to /dev/null
Diffstat (limited to 'apt-pkg/contrib/fileutl.cc')
-rw-r--r-- | apt-pkg/contrib/fileutl.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index 9e3611b26..e9d1ba1ce 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -1098,6 +1098,12 @@ bool FileFd::OpenInternDescriptor(unsigned int const Mode, APT::Configuration::C dup2(d->compressed_fd,STDIN_FILENO); dup2(Pipe[1],STDOUT_FILENO); } + int const nullfd = open("/dev/null", O_WRONLY); + if (nullfd != -1) + { + dup2(nullfd,STDERR_FILENO); + close(nullfd); + } SetCloseExec(STDOUT_FILENO,false); SetCloseExec(STDIN_FILENO,false); |