summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/fileutl.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2014-04-28 12:50:47 +0200
committerMichael Vogt <mvo@debian.org>2014-04-28 12:50:47 +0200
commit77efe478cc59fe205c35036bae8c0d5e0e6913d7 (patch)
tree292ddf183b3f38c299bd6614fbd48585aa6d00b2 /apt-pkg/contrib/fileutl.cc
parent814e1b8d623cb1e6b03c79fcdab6b20754c57038 (diff)
parent038e721ad2557fd517eae4b102cd36080f4ee6e3 (diff)
Merge branch 'debian/sid' into ubuntu/master
Conflicts: po/vi.po
Diffstat (limited to 'apt-pkg/contrib/fileutl.cc')
-rw-r--r--apt-pkg/contrib/fileutl.cc17
1 files changed, 4 insertions, 13 deletions
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc
index de73a7fd8..b77c7ff7f 100644
--- a/apt-pkg/contrib/fileutl.cc
+++ b/apt-pkg/contrib/fileutl.cc
@@ -58,13 +58,10 @@
#include <bzlib.h>
#endif
#ifdef HAVE_LZMA
- #include <stdint.h>
#include <lzma.h>
#endif
-
-#ifdef WORDS_BIGENDIAN
-#include <inttypes.h>
-#endif
+#include <endian.h>
+#include <stdint.h>
#include <apti18n.h>
/*}}}*/
@@ -1880,19 +1877,13 @@ unsigned long long FileFd::Size()
FileFdErrno("lseek","Unable to seek to end of gzipped file");
return 0;
}
- size = 0;
+ uint32_t size = 0;
if (read(iFd, &size, 4) != 4)
{
FileFdErrno("read","Unable to read original size of gzipped file");
return 0;
}
-
-#ifdef WORDS_BIGENDIAN
- uint32_t tmp_size = size;
- uint8_t const * const p = (uint8_t const * const) &tmp_size;
- tmp_size = (p[3] << 24) | (p[2] << 16) | (p[1] << 8) | p[0];
- size = tmp_size;
-#endif
+ size = le32toh(size);
if (lseek(iFd, oldPos, SEEK_SET) < 0)
{