diff --git a/src/cio_file.c b/src/cio_file.c index 1747a49..373f1a6 100644 --- a/src/cio_file.c +++ b/src/cio_file.c @@ -1049,10 +1049,10 @@ int cio_file_fs_size_change(struct cio_file *cf, size_t new_size) * fallocate() is not portable, Linux only. */ ret = fallocate(cf->fd, 0, 0, new_size); - if (ret == EOPNOTSUPP) { - /* If fallocate fails with an EOPNOTSUPP try operation using - * posix_fallocate. Required since some filesystems do not support - * the fallocate operation e.g. ext3 and reiserfs. + if (ret != 0) { + /* If fallocate fails with an non zero return code try operation + * using posix_fallocate. Required since some filesystems do not + * support the fallocate operation e.g. ext3 and reiserfs. */ ret = posix_fallocate(cf->fd, 0, new_size); }