]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/contrib/fileutl.cc
copy ReadWrite-error to the bottom to make clang happy
[apt.git] / apt-pkg / contrib / fileutl.cc
index 9f95a2a90c1c9bbe89bcbcb9b83d57df073f69e4..52fedce8f9111e247be6a53e8f3103aaf7a2e318 100644 (file)
@@ -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;