about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2009-09-30T09·54+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2009-09-30T09·54+0000
commit1a8f8fd86fb89222f6fadab0d9f8a0fb850c8f6f (patch)
treeff03d2593683baa2fd85d1ec5cc97c05e6f5a999
parent0f79ad47c5af646ad7a42f86759170df8081899c (diff)
* OpenSolaris compatibility.
-rw-r--r--src/libutil/archive.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libutil/archive.cc b/src/libutil/archive.cc
index 4899fbaa4580..f30e5b7cf694 100644
--- a/src/libutil/archive.cc
+++ b/src/libutil/archive.cc
@@ -302,7 +302,12 @@ struct RestoreSink : ParseSink
 #if HAVE_POSIX_FALLOCATE
         if (len) {
             errno = posix_fallocate(fd, 0, len);
-            if (errno) throw SysError(format("preallocating file of %1% bytes") % len);
+            /* Note that EINVAL may indicate that the underlying
+               filesystem doesn't support preallocation (e.g. on
+               OpenSolaris).  Since preallocation is just an
+               optimisation, ignore it. */
+            if (errno && errno != EINVAL)
+                throw SysError(format("preallocating file of %1% bytes") % len);
         }
 #endif
     }