1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2024-09-19 23:03:53 -04:00

* OpenSolaris compatibility.

This commit is contained in:
Eelco Dolstra 2009-09-30 09:54:29 +00:00
parent 0f79ad47c5
commit 1a8f8fd86f

View file

@ -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
}