Explorar o código

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
David Kalnischkies %!s(int64=11) %!d(string=hai) anos
pai
achega
8f5b67ae14
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      apt-pkg/contrib/fileutl.cc

+ 4 - 1
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;