summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2014-03-27 15:20:49 +0100
committerMichael Vogt <mvo@debian.org>2014-03-27 15:20:49 +0100
commit355a960dd8bfbe2606be95d38aafd6bc0675d76f (patch)
tree67c58c736cee0f96f65b3de5e1070e1e1af92672 /apt-pkg/contrib
parentfa211e2d3b0305cfdd184cdba9750259f6d9c98e (diff)
parent62f1ee1cc7a5e16ca0cbfbee3c00cefab1892f87 (diff)
Merge branch 'debian/sid' into feature/more-fancy-progress
Diffstat (limited to 'apt-pkg/contrib')
-rw-r--r--apt-pkg/contrib/fileutl.cc15
-rw-r--r--apt-pkg/contrib/fileutl.h6
-rw-r--r--apt-pkg/contrib/macros.h4
3 files changed, 21 insertions, 4 deletions
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc
index 1eabf37f4..69406a9bf 100644
--- a/apt-pkg/contrib/fileutl.cc
+++ b/apt-pkg/contrib/fileutl.cc
@@ -1191,7 +1191,7 @@ bool FileFd::OpenInternDescriptor(unsigned int const Mode, APT::Configuration::C
d->openmode = Mode;
d->compressor = compressor;
#if defined HAVE_ZLIB || defined HAVE_BZ2 || defined HAVE_LZMA
- if (AutoClose == false && compress_open != NULL)
+ if ((Flags & AutoClose) != AutoClose && compress_open != NULL)
{
// Need to duplicate fd here or gz/bz2 close for cleanup will close the fd as well
int const internFd = dup(iFd);
@@ -1430,7 +1430,15 @@ bool FileFd::Read(void *To,unsigned long long Size,unsigned long long *Actual)
errno = 0;
}
else
+ {
Res = Size - d->lzma->stream.avail_out;
+ if (Res == 0)
+ {
+ // lzma run was okay, but produced no output…
+ Res = -1;
+ errno = EINTR;
+ }
+ }
}
#endif
else
@@ -1439,7 +1447,12 @@ bool FileFd::Read(void *To,unsigned long long Size,unsigned long long *Actual)
if (Res < 0)
{
if (errno == EINTR)
+ {
+ // trick the while-loop into running again
+ Res = 1;
+ errno = 0;
continue;
+ }
if (false)
/* dummy so that the rest can be 'else if's */;
#ifdef HAVE_ZLIB
diff --git a/apt-pkg/contrib/fileutl.h b/apt-pkg/contrib/fileutl.h
index 278a25742..f25ed3622 100644
--- a/apt-pkg/contrib/fileutl.h
+++ b/apt-pkg/contrib/fileutl.h
@@ -150,11 +150,11 @@ class FileFd
private:
FileFdPrivate* d;
- bool OpenInternDescriptor(unsigned int const Mode, APT::Configuration::Compressor const &compressor);
+ APT_HIDDEN bool OpenInternDescriptor(unsigned int const Mode, APT::Configuration::Compressor const &compressor);
// private helpers to set Fail flag and call _error->Error
- bool FileFdErrno(const char* Function, const char* Description,...) APT_PRINTF(3) APT_COLD;
- bool FileFdError(const char* Description,...) APT_PRINTF(2) APT_COLD;
+ APT_HIDDEN bool FileFdErrno(const char* Function, const char* Description,...) APT_PRINTF(3) APT_COLD;
+ APT_HIDDEN bool FileFdError(const char* Description,...) APT_PRINTF(2) APT_COLD;
};
bool RunScripts(const char *Cnf);
diff --git a/apt-pkg/contrib/macros.h b/apt-pkg/contrib/macros.h
index d97053553..2d6448e5e 100644
--- a/apt-pkg/contrib/macros.h
+++ b/apt-pkg/contrib/macros.h
@@ -94,8 +94,12 @@
#if APT_GCC_VERSION >= 0x0400
#define APT_SENTINEL __attribute__((sentinel))
+ #define APT_PUBLIC __attribute__ ((visibility ("default")))
+ #define APT_HIDDEN __attribute__ ((visibility ("hidden")))
#else
#define APT_SENTINEL
+ #define APT_PUBLIC
+ #define APT_HIDDEN
#endif
// cold functions are unlikely() to be called