Use do_ftruncate() for the added call too.
authorWayne Davison <wayned@samba.org>
Sat, 6 Nov 2010 17:41:39 +0000 (10:41 -0700)
committerWayne Davison <wayned@samba.org>
Sat, 6 Nov 2010 17:41:39 +0000 (10:41 -0700)
preallocate.diff

index 934b340a98a23a363909f0d228378a36a36bc068..84da27a006ab5bc9fd5a394eff4de50aba78678f 100644 (file)
@@ -379,7 +379,7 @@ diff --git a/util.c b/util.c
 +#ifdef PREALLOCATE_NEEDS_TRUNCATE
 +      /* Source file might have shrunk since we fstatted it.
 +       * Cut off any extra preallocated zeros from dest file. */
-+      if (offset < preallocated_len && ftruncate(ofd, offset) < 0) {
++      if (offset < preallocated_len && do_ftruncate(ofd, offset) < 0) {
 +              /* If we fail to truncate, the dest file may be wrong, so we
 +               * must trigger the "partial transfer" error. */
 +              rsyserr(FERROR_XFER, errno, "ftruncate %s", full_fname(dest));