Moved the mkfifo() and socket-making stuff from tru64.diff to here so
[rsync/rsync-patches.git] / fsync.diff
index a5ddfce..77c8930 100644 (file)
@@ -1,7 +1,7 @@
 This patch from Sami Farin lets you specify --fsync if you want fsync()
 to be called on every file we write.
 
---- orig/options.c     2004-07-29 16:08:03
+--- orig/options.c     2004-09-20 05:10:48
 +++ options.c  2004-07-03 20:18:13
 @@ -38,6 +38,7 @@ int make_backups = 0;
   **/
@@ -27,7 +27,7 @@ to be called on every file we write.
    {"dry-run",         'n', POPT_ARG_NONE,   &dry_run, 0, 0, 0 },
    {"sparse",          'S', POPT_ARG_NONE,   &sparse_files, 0, 0, 0 },
    {"cvs-exclude",     'C', POPT_ARG_NONE,   &cvs_exclude, 0, 0, 0 },
-@@ -1021,6 +1024,9 @@ void server_options(char **args,int *arg
+@@ -1074,6 +1077,9 @@ void server_options(char **args,int *arg
                args[ac++] = tmpdir;
        }
  
@@ -37,9 +37,9 @@ to be called on every file we write.
        if (compare_dest && am_sender) {
                /* the server only needs this option if it is not the sender,
                 *   and it may be an older version that doesn't know this
---- orig/receiver.c    2004-07-29 16:08:03
+--- orig/receiver.c    2004-09-21 09:40:27
 +++ receiver.c 2004-07-16 20:13:31
-@@ -37,6 +37,7 @@ extern int preserve_hard_links;
+@@ -36,6 +36,7 @@ extern int preserve_hard_links;
  extern int preserve_perms;
  extern int cvs_exclude;
  extern int io_error;
@@ -47,11 +47,11 @@ to be called on every file we write.
  extern char *tmpdir;
  extern char *partial_dir;
  extern char *compare_dest;
-@@ -309,6 +310,12 @@ static int receive_data(int f_in, char *
+@@ -305,6 +306,12 @@ static int receive_data(int f_in, char *
                exit_cleanup(RERR_FILEIO);
        }
  
-+      if (do_fsync && (fd != -1) && (fsync(fd) != 0)) {
++      if (do_fsync && fd != -1 && fsync(fd) != 0) {
 +              rsyserr(FERROR, errno, "fsync failed on %s",
 +                      full_fname(fname));
 +              exit_cleanup(RERR_FILEIO);
@@ -60,7 +60,7 @@ to be called on every file we write.
        sum_end(file_sum1);
  
        if (mapbuf)
---- orig/util.c        2004-07-29 16:08:04
+--- orig/util.c        2004-09-07 21:45:30
 +++ util.c     2004-07-03 20:18:13
 @@ -33,6 +33,7 @@ extern int module_id;
  extern int modify_window;