X-Git-Url: https://mattmccutchen.net/rsync/rsync-patches.git/blobdiff_plain/87a38eea930df6ee2db0da2017c30116117b1d4b..9fa103b8814d1a53ffefc75d8949d8c1ba3d222c:/fsync.diff diff --git a/fsync.diff b/fsync.diff index 7af19ea..9877bcb 100644 --- a/fsync.diff +++ b/fsync.diff @@ -86,16 +86,17 @@ To use this patch, run these commands for a successful build: extern int modify_window; extern int relative_paths; extern int human_readable; -@@ -315,6 +316,12 @@ int copy_file(const char *source, const - return -1; +@@ -309,6 +310,13 @@ int copy_file(const char *source, const + full_fname(source)); } + if (do_fsync && fsync(ofd) < 0) { + rsyserr(FERROR, errno, "fsync failed on %s", + full_fname(dest)); ++ close(ofd); + return -1; + } + - return 0; - } - + if (close(ofd) < 0) { + rsyserr(FERROR, errno, "close failed on %s", + full_fname(dest));