We now compile when UF_NOUNLINK and/or SF_NOUNLINK are undefined.
[rsync/rsync-patches.git] / fsync.diff
index 7af19ea..9877bcb 100644 (file)
@@ -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));