{"inplace", 0, POPT_ARG_VAL, &inplace, 1, 0, 0 },
{"no-inplace", 0, POPT_ARG_VAL, &inplace, 0, 0, 0 },
{"append", 0, POPT_ARG_NONE, 0, OPT_APPEND, 0, 0 },
-@@ -2048,6 +2057,9 @@ void server_options(char **args, int *argc_p)
+@@ -2053,6 +2062,9 @@ void server_options(char **args, int *argc_p)
else if (remove_source_files)
args[ac++] = "--remove-sent-files";
diff --git a/rsync.h b/rsync.h
--- a/rsync.h
+++ b/rsync.h
-@@ -608,6 +608,13 @@ struct ht_int64_node {
+@@ -612,6 +612,13 @@ struct ht_int64_node {
#define ACLS_NEED_MASK 1
#endif
-n, --dry-run perform a trial run with no changes made
-W, --whole-file copy files whole (w/o delta-xfer algorithm)
-x, --one-file-system don't cross filesystem boundaries
-@@ -1043,6 +1044,18 @@ NOTE: Don't use this option when the destination is a Solaris "tmpfs"
+@@ -1049,6 +1050,18 @@ NOTE: Don't use this option when the destination is a Solaris "tmpfs"
filesystem. It doesn't seem to handle seeks over null regions
correctly and ends up corrupting the files.
extern int module_id;
extern int modify_window;
extern int relative_paths;
-@@ -273,6 +274,10 @@ int copy_file(const char *source, const char *dest, int ofd,
+@@ -276,6 +277,10 @@ int copy_file(const char *source, const char *dest, int ofd,
int ifd;
char buf[1024 * 8];
int len; /* Number of bytes read into `buf'. */
+#endif
if ((ifd = do_open(source, O_RDONLY, 0)) < 0) {
- rsyserr(FERROR_XFER, errno, "open %s", full_fname(source));
-@@ -294,7 +299,27 @@ int copy_file(const char *source, const char *dest, int ofd,
+ int save_errno = errno;
+@@ -309,7 +314,27 @@ int copy_file(const char *source, const char *dest, int ofd,
}
}
+ offset += len;
+#endif
if (full_write(ofd, buf, len) < 0) {
+ int save_errno = errno;
rsyserr(FERROR_XFER, errno, "write %s", full_fname(dest));
- close(ifd);
-@@ -315,6 +340,16 @@ int copy_file(const char *source, const char *dest, int ofd,
+@@ -334,6 +359,16 @@ int copy_file(const char *source, const char *dest, int ofd,
full_fname(source));
}
+#endif
+
if (close(ofd) < 0) {
+ int save_errno = errno;
rsyserr(FERROR_XFER, errno, "close failed on %s",
- full_fname(dest));