Mercurial > dovecot > original-hg > dovecot-1.1
changeset 8336:25395b1fa1b7 HEAD
Handle posix_fallocate() failures correctly. Check also for AIX's "not supported" failure.
Based on patch by Ralf Becker.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 30 Jul 2009 14:07:13 -0400 |
parents | 9102291ebfc1 |
children | c73be201a48b |
files | src/lib/file-set-size.c |
diffstat | 1 files changed, 7 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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 @@ #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; }