about summary refs log tree commit diff
path: root/src/libutil/serialise.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2009-03-22T17·36+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2009-03-22T17·36+0000
commit77d272623fb4fd57cf27d4b92a7dc1713a2d4098 (patch)
tree37c40b30768dfe348527a93237652e041280419a /src/libutil/serialise.cc
parent7e05b8b75e0f4b370cc7d4b78b3fb18a3678b360 (diff)
* 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.

Diffstat (limited to 'src/libutil/serialise.cc')
-rw-r--r--src/libutil/serialise.cc4
1 files changed, 2 insertions, 2 deletions
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) |