dovecot-1.1: Handle posix_fallocate() failures correctly. Check ...
dovecot at dovecot.org
dovecot at dovecot.org
Thu Jul 30 21:07:34 EEST 2009
details: http://hg.dovecot.org/dovecot-1.1/rev/25395b1fa1b7
changeset: 8336:25395b1fa1b7
user: Timo Sirainen <tss at iki.fi>
date: Thu Jul 30 14:07:13 2009 -0400
description:
Handle posix_fallocate() failures correctly. Check also for AIX's "not supported" failure.
Based on patch by Ralf Becker.
diffstat:
1 file changed, 7 insertions(+), 3 deletions(-)
src/lib/file-set-size.c | 10 +++++++---
diffs (22 lines):
diff -r 9102291ebfc1 -r 25395b1fa1b7 src/lib/file-set-size.c
--- a/src/lib/file-set-size.c Wed Jul 29 14:49:14 2009 -0400
+++ b/src/lib/file-set-size.c Thu Jul 30 14:07:13 2009 -0400
@@ -43,11 +43,15 @@ int file_set_size(int fd, off_t size)
#ifdef HAVE_POSIX_FALLOCATE
if (posix_fallocate_supported) {
- if (posix_fallocate(fd, st.st_size, size - st.st_size) == 0)
+ int err;
+
+ err = posix_fallocate(fd, st.st_size, size - st.st_size);
+ if (err == 0)
return 0;
- if (errno != EINVAL /* Solaris */) {
- if (!ENOSPACE(errno))
+ if (err != EINVAL /* Solaris */ &&
+ err != EOPNOTSUPP /* AOX */) {
+ if (!ENOSPACE(err))
i_error("posix_fallocate() failed: %m");
return -1;
}
More information about the dovecot-cvs
mailing list