Fixed a bunch of "warn_unused_result" compiler warnings.
[rsync/rsync.git] / receiver.c
index 9164247..7efd3d2 100644 (file)
@@ -285,8 +285,12 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
                goto report_write_error;
 
 #ifdef HAVE_FTRUNCATE
-       if (inplace && fd != -1)
-               ftruncate(fd, offset);
+       if (inplace && fd != -1) {
+               if (ftruncate(fd, offset) < 0) {
+                       rsyserr(FWARNING, errno, "ftruncate failed on %s",
+                               full_fname(fname));
+               }
+       }
 #endif
 
        if (INFO_GTE(PROGRESS, 1))