summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2013-07-25 20:22:43 +0200
committerMichael Vogt <mvo@debian.org>2013-07-25 20:22:43 +0200
commitfe0036dd7e3bbd808fa526e2e142fdb89105caae (patch)
treea31ad68247f53bd5e4b2f68e87430ad93e04ebed /apt-pkg/contrib
parentc104200045ef19f5ee061c4a00b468482ac65dc4 (diff)
rework the code in cdromutl.cc to make coverity (more) happy
Diffstat (limited to 'apt-pkg/contrib')
-rw-r--r--apt-pkg/contrib/cdromutl.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/apt-pkg/contrib/cdromutl.cc b/apt-pkg/contrib/cdromutl.cc
index 187f6bd59..afa01a562 100644
--- a/apt-pkg/contrib/cdromutl.cc
+++ b/apt-pkg/contrib/cdromutl.cc
@@ -122,8 +122,9 @@ bool MountCdrom(string Path, string DeviceName)
if (Child == 0)
{
// Make all the fds /dev/null
+ int null_fd = open("/dev/null",O_RDWR);
for (int I = 0; I != 3; I++)
- dup2(open("/dev/null",O_RDWR),I);
+ dup2(null_fd, I);
if (_config->Exists("Acquire::cdrom::"+Path+"::Mount") == true)
{