From: Timo Sirainen Date: Mon, 22 Sep 2008 18:23:37 +0000 (+0300) Subject: AIX: Silently ignore posix_fallocate() failures. X-Git-Tag: 1.2.alpha2~41 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ae09b6d5101856e468d4739e86473b8519124bb5;p=thirdparty%2Fdovecot%2Fcore.git AIX: Silently ignore posix_fallocate() failures. --HG-- branch : HEAD --- diff --git a/src/lib/file-set-size.c b/src/lib/file-set-size.c index bb3626e3f6..47de0676e0 100644 --- a/src/lib/file-set-size.c +++ b/src/lib/file-set-size.c @@ -46,13 +46,13 @@ int file_set_size(int fd, off_t size) if (posix_fallocate(fd, st.st_size, size - st.st_size) == 0) return 0; - if (errno != EINVAL) { + if (errno != EINVAL /* Solaris */ && + errno != ENOPROTOOPT /* AIX */) { if (!ENOSPACE(errno)) i_error("posix_fallocate() failed: %m"); return -1; } - /* Solaris seems to fail with EINVAL if it's not supported - by the kernel. Fallback to writing. */ + /* Not supported by kernel, fallback to writing. */ posix_fallocate_supported = FALSE; } #endif