diff --git a/src/libutil/archive.cc b/src/libutil/archive.cc index 4899fbaa45..f30e5b7cf6 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 }