Fix --prealloc to keep file-size 0 when possible.
[rsync.git] / syscall.c
index dbd556b8a3ddb9759f5f04a2d52c7dca8765439a..0d1221b3dbf91756ee7bea13cebd63a9690377fc 100644 (file)
--- a/syscall.c
+++ b/syscall.c
@@ -462,7 +462,7 @@ int do_utime(const char *fname, time_t modtime, UNUSED(uint32 mod_nsec))
 
 OFF_T do_fallocate(int fd, OFF_T offset, OFF_T length)
 {
-       int opts = inplace || preallocate_files ? 0 : DO_FALLOC_OPTIONS;
+       int opts = inplace || preallocate_files ? DO_FALLOC_OPTIONS : 0;
        int ret;
        RETURN_ERROR_IF(dry_run, 0);
        RETURN_ERROR_IF_RO_OR_LO;