]> git.saurik.com Git - apt.git/blobdiff - apt-inst/dirstream.cc
fix off-by-one error and do not use magic constant of 100 when checking StackPost
[apt.git] / apt-inst / dirstream.cc
index bb0bf96c18a480bdaa32727b73637224a85f2b92..65d1aa188a6b3080fa7e8c3177d53ff0e6c124ba 100644 (file)
@@ -46,15 +46,13 @@ bool pkgDirStream::DoItem(Item &Itm,int &Fd)
         // fchmod deals with umask and fchown sets the ownership
         if (fchmod(iFd,Itm.Mode) != 0)
         {
-           _error->Errno("fchmod",_("Failed to write file %s"), Itm.Name);
            close(iFd);
-           return false;
+           return _error->Errno("fchmod",_("Failed to write file %s"), Itm.Name);
         }
         if (fchown(iFd,Itm.UID,Itm.GID) != 0 && errno != EPERM)
         {
-           return _error->Errno("fchown",_("Failed to write file %s"), Itm.Name);
            close(iFd);
-           return false;
+           return _error->Errno("fchown",_("Failed to write file %s"), Itm.Name);
         }
         Fd = iFd;
         return true;