]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
AIX: Silently ignore posix_fallocate() failures.
authorTimo Sirainen <tss@iki.fi>
Mon, 22 Sep 2008 18:23:37 +0000 (21:23 +0300)
committerTimo Sirainen <tss@iki.fi>
Mon, 22 Sep 2008 18:23:37 +0000 (21:23 +0300)
--HG--
branch : HEAD

src/lib/file-set-size.c

index bb3626e3f6dd6e6c39919e1f270057af44446a40..47de0676e097ad465bfc614837127671ed3bbdf5 100644 (file)
@@ -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