Mention some chanages in the patches dir.
[rsync/rsync.git] / receiver.c
index d348cf8..5a88311 100644 (file)
@@ -46,6 +46,7 @@ extern int module_id;
 extern int ignore_errors;
 extern int orig_umask;
 extern int append_mode;
+extern int sparse_files;
 extern int keep_partial;
 extern int checksum_seed;
 extern int inplace;
@@ -219,12 +220,16 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
                if (sum.remainder)
                        sum.flength -= sum.blength - sum.remainder;
                for (j = CHUNK_SIZE; j < sum.flength; j += CHUNK_SIZE) {
+                       if (do_progress)
+                               show_progress(offset, total_size);
                        sum_update(map_ptr(mapbuf, offset, CHUNK_SIZE),
                                   CHUNK_SIZE);
                        offset = j;
                }
                if (offset < sum.flength) {
                        int32 len = sum.flength - offset;
+                       if (do_progress)
+                               show_progress(offset, total_size);
                        sum_update(map_ptr(mapbuf, offset, len), len);
                        offset = sum.flength;
                }
@@ -349,6 +354,8 @@ static void handle_delayed_updates(struct file_list *flist, char *local_name)
                                        safe_fname(partialptr),
                                        safe_fname(fname));
                        }
+                       /* We don't use robust_rename() here because the
+                        * partial-dir must be on the same drive. */
                        if (do_rename(partialptr, fname) < 0) {
                                rsyserr(FERROR, errno,
                                        "rename failed for %s (from %s)",
@@ -440,7 +447,10 @@ int recv_files(int f_in, struct file_list *flist, char *local_name)
                        send_msg(MSG_DONE, "", 0);
                        if (keep_partial && !partial_dir)
                                make_backups = 0; /* prevents double backup */
-                       append_mode = 0;
+                       if (append_mode) {
+                               append_mode = 0;
+                               sparse_files = 0;
+                       }
                        continue;
                }
 
@@ -605,7 +615,7 @@ int recv_files(int f_in, struct file_list *flist, char *local_name)
 
                /* We now check to see if we are writing file "inplace" */
                if (inplace)  {
-                       fd2 = do_open(fname, O_WRONLY|O_CREAT, 0);
+                       fd2 = do_open(fname, O_WRONLY|O_CREAT, 0600);
                        if (fd2 == -1) {
                                rsyserr(FERROR, errno, "open %s failed",
                                        full_fname(fname));