From 1e3f4083db29bba600b9725e9456b0e140975c99 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Sat, 22 Feb 2014 18:34:33 +0100 Subject: Fix typos in documentation (codespell) --- apt-inst/contrib/extracttar.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-inst/contrib/extracttar.cc') diff --git a/apt-inst/contrib/extracttar.cc b/apt-inst/contrib/extracttar.cc index fb4db42f8..2437c9749 100644 --- a/apt-inst/contrib/extracttar.cc +++ b/apt-inst/contrib/extracttar.cc @@ -6,7 +6,7 @@ Extract a Tar - Tar Extractor Some performance measurements showed that zlib performed quite poorly - in comparision to a forked gzip process. This tar extractor makes use + in comparison to a forked gzip process. This tar extractor makes use of the fact that dup'd file descriptors have the same seek pointer and that gzip will not read past the end of a compressed stream, even if there is more data. We use the dup property to track extraction -- cgit v1.2.3 From 3255db2d02358e0026c3e6d0d8cc1519bcd48faf Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sun, 16 Feb 2014 23:29:13 +0100 Subject: ExtractTar: Allow an empty decompressor program This allows for uncompressed tar files, as the decompressor process will not get interposed in-between the file descriptors. --- apt-inst/contrib/extracttar.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'apt-inst/contrib/extracttar.cc') diff --git a/apt-inst/contrib/extracttar.cc b/apt-inst/contrib/extracttar.cc index 2437c9749..41301d1a6 100644 --- a/apt-inst/contrib/extracttar.cc +++ b/apt-inst/contrib/extracttar.cc @@ -111,6 +111,12 @@ bool ExtractTar::Done(bool Force) gzip will efficiently ignore the extra bits. */ bool ExtractTar::StartGzip() { + if (DecompressProg.empty()) + { + InFd.OpenDescriptor(File.Fd(), FileFd::ReadOnly, FileFd::None, false); + return true; + } + int Pipes[2]; if (pipe(Pipes) != 0) return _error->Errno("pipe",_("Failed to create pipes")); -- cgit v1.2.3 From cf4ff3b78dc347188949370db914fe6329be6c99 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 27 Feb 2014 01:54:10 +0100 Subject: warning: cast from type A to type B casts away qualifiers [-Wcast-qual] Git-Dch: Ignore Reported-By: gcc -Wcast-qual --- apt-inst/contrib/extracttar.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'apt-inst/contrib/extracttar.cc') diff --git a/apt-inst/contrib/extracttar.cc b/apt-inst/contrib/extracttar.cc index 41301d1a6..41c509809 100644 --- a/apt-inst/contrib/extracttar.cc +++ b/apt-inst/contrib/extracttar.cc @@ -120,7 +120,7 @@ bool ExtractTar::StartGzip() int Pipes[2]; if (pipe(Pipes) != 0) return _error->Errno("pipe",_("Failed to create pipes")); - + // Fork off the process GZPid = ExecFork(); @@ -136,9 +136,9 @@ bool ExtractTar::StartGzip() dup2(Fd,STDERR_FILENO); close(Fd); SetCloseExec(STDOUT_FILENO,false); - SetCloseExec(STDIN_FILENO,false); + SetCloseExec(STDIN_FILENO,false); SetCloseExec(STDERR_FILENO,false); - + const char *Args[3]; string confvar = string("dir::bin::") + DecompressProg; string argv0 = _config->Find(confvar.c_str(),DecompressProg.c_str()); -- cgit v1.2.3 From 453b82a388013e522b3a1b9fcd6ed0810dab1f4f Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 5 Mar 2014 22:11:25 +0100 Subject: cleanup headers and especially #includes everywhere Beside being a bit cleaner it hopefully also resolves oddball problems I have with high levels of parallel jobs. Git-Dch: Ignore Reported-By: iwyu (include-what-you-use) --- apt-inst/contrib/extracttar.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'apt-inst/contrib/extracttar.cc') diff --git a/apt-inst/contrib/extracttar.cc b/apt-inst/contrib/extracttar.cc index 41c509809..0ba3f0521 100644 --- a/apt-inst/contrib/extracttar.cc +++ b/apt-inst/contrib/extracttar.cc @@ -23,9 +23,11 @@ #include #include #include -#include +#include -#include +#include +#include +#include #include #include #include -- cgit v1.2.3