SHA256
1
0
forked from pool/rsync
rsync/rsync-fix-prealloc-to-keep-file-size-0-when-possible.patch
2019-04-15 16:47:49 +00:00

26 lines
755 B
Diff

From c2da3809f714d936dec1cab6d5bf8b724b9cd113 Mon Sep 17 00:00:00 2001
From: Wayne Davison <wayned@samba.org>
Date: Tue, 15 Jan 2019 08:51:08 -0800
Subject: [PATCH] Fix --prealloc to keep file-size 0 when possible.
---
syscall.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/syscall.c b/syscall.c
index dbd556b8..0d1221b3 100644
--- 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;
--
2.16.4