From 77d272623fb4fd57cf27d4b92a7dc1713a2d4098 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 22 Mar 2009 17:36:43 +0000 Subject: * NAR archives: handle files larger than 2^32 bytes. Previously it would just silently store only (fileSize % 2^32) bytes. * Use posix_fallocate if available when unpacking archives. * Provide a better error message when trying to unpack something that isn't a NAR archive. --- src/libutil/serialise.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libutil/serialise.cc') diff --git a/src/libutil/serialise.cc b/src/libutil/serialise.cc index c13e8c7e38e5..9b422271323f 100644 --- a/src/libutil/serialise.cc +++ b/src/libutil/serialise.cc @@ -80,7 +80,7 @@ void readPadding(unsigned int len, Source & source) unsigned int n = 8 - (len % 8); source(zero, n); for (unsigned int i = 0; i < n; i++) - if (zero[i]) throw Error("non-zero padding"); + if (zero[i]) throw SerialisationError("non-zero padding"); } } @@ -90,7 +90,7 @@ unsigned int readInt(Source & source) unsigned char buf[8]; source(buf, sizeof(buf)); if (buf[4] || buf[5] || buf[6] || buf[7]) - throw Error("implementation cannot deal with > 32-bit integers"); + throw SerialisationError("implementation cannot deal with > 32-bit integers"); return buf[0] | (buf[1] << 8) | -- cgit 1.4.1