dovecot-1.1: AIX: Silently ignore posix_fallocate() failures.

dovecot at dovecot.org dovecot at dovecot.org
Mon Sep 22 21:23:17 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/ad13463328aa
changeset: 7890:ad13463328aa
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Sep 22 21:23:13 2008 +0300
description:
AIX: Silently ignore posix_fallocate() failures.

diffstat:

1 file changed, 3 insertions(+), 3 deletions(-)
src/lib/file-set-size.c |    6 +++---

diffs (20 lines):

diff -r a78e8c0dd965 -r ad13463328aa src/lib/file-set-size.c
--- a/src/lib/file-set-size.c	Mon Sep 22 21:08:07 2008 +0300
+++ b/src/lib/file-set-size.c	Mon Sep 22 21:23:13 2008 +0300
@@ -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


More information about the dovecot-cvs mailing list