summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/fileutl.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2015-09-07 21:14:55 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2015-09-14 15:22:18 +0200
commit8f5b67ae1488f5addc70b337aea7aa1ced168550 (patch)
treeaa52a94664acb9d59be0f389211d343963850dac /apt-pkg/contrib/fileutl.cc
parent92b2e38dd1334d7f7a30358124c4fad766ca4666 (diff)
copy ReadWrite-error to the bottom to make clang happy
clang detects that fd isn't set in the ReadWrite case – just that this is supposed to be catched earlier in this method already, but it doesn't hurt to make it explicit here as well and clang is happy, too. Git-Dch: Ignore
Diffstat (limited to 'apt-pkg/contrib/fileutl.cc')
-rw-r--r--apt-pkg/contrib/fileutl.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc
index 9f95a2a90..52fedce8f 100644
--- a/apt-pkg/contrib/fileutl.cc
+++ b/apt-pkg/contrib/fileutl.cc
@@ -2230,11 +2230,14 @@ bool Popen(const char* Args[], FileFd &Fd, pid_t &Child, FileFd::OpenMode Mode)/
{
close(Pipe[1]);
fd = Pipe[0];
- } else if(Mode == FileFd::WriteOnly)
+ }
+ else if(Mode == FileFd::WriteOnly)
{
close(Pipe[0]);
fd = Pipe[1];
}
+ else
+ return _error->Error("Popen supports ReadOnly (x)or WriteOnly mode only");
Fd.OpenDescriptor(fd, Mode, FileFd::None, true);
return true;