summaryrefslogtreecommitdiff
path: root/ftparchive/writer.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2011-12-14 22:35:03 +0100
committerDavid Kalnischkies <kalnischkies@gmail.com>2011-12-14 22:35:03 +0100
commit12d1f5b3e295c589371bf7de27b7918310d08480 (patch)
treeea3c89ca71f1d5240e43b40c4f01e5921b7d22ab /ftparchive/writer.cc
parent52b47296f61ec3ca1075bbfb44982f5caa541e7c (diff)
remove the second usage instance of ExecCompressor in ftparchive
by again using the FileFd directly
Diffstat (limited to 'ftparchive/writer.cc')
-rw-r--r--ftparchive/writer.cc23
1 files changed, 8 insertions, 15 deletions
diff --git a/ftparchive/writer.cc b/ftparchive/writer.cc
index 27e53faf8..02777713c 100644
--- a/ftparchive/writer.cc
+++ b/ftparchive/writer.cc
@@ -889,22 +889,16 @@ bool ContentsWriter::ReadFromPkgs(string const &PkgFile,string const &PkgCompres
MultiCompress Pkgs(PkgFile,PkgCompress,0,false);
if (_error->PendingError() == true)
return false;
-
+
// Open the package file
- int CompFd = -1;
- pid_t Proc = -1;
- if (Pkgs.OpenOld(CompFd,Proc) == false)
+ FileFd Fd;
+ if (Pkgs.OpenOld(Fd) == false)
return false;
-
- // No auto-close FD
- FileFd Fd(CompFd,false);
+
pkgTagFile Tags(&Fd);
if (_error->PendingError() == true)
- {
- Pkgs.CloseOld(CompFd,Proc);
return false;
- }
-
+
// Parse.
pkgTagSection Section;
while (Tags.Step(Section) == true)
@@ -926,11 +920,10 @@ bool ContentsWriter::ReadFromPkgs(string const &PkgFile,string const &PkgCompres
_error->DumpErrors();
}
}
-
+
// Tidy the compressor
- if (Pkgs.CloseOld(CompFd,Proc) == false)
- return false;
-
+ Fd.Close();
+
return true;
}