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;
**/
{"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;
}
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;
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);
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;