Adding 3.0.4 release line to OLDNEWS.
[rsync/rsync.git] / generator.c
index 8290e60..8557740 100644 (file)
@@ -21,6 +21,7 @@
  */
 
 #include "rsync.h"
+#include "inums.h"
 
 extern int dry_run;
 extern int do_xfers;
@@ -53,6 +54,7 @@ extern int ignore_errors;
 extern int remove_source_files;
 extern int delay_updates;
 extern int update_only;
+extern int human_readable;
 extern int ignore_existing;
 extern int ignore_non_existing;
 extern int inplace;
@@ -86,7 +88,6 @@ extern int unsort_ndx;
 extern int max_delete;
 extern int force_delete;
 extern int one_file_system;
-extern int check_for_io_err;
 extern struct stats stats;
 extern dev_t filesystem_dev;
 extern mode_t orig_umask;
@@ -807,8 +808,8 @@ static void sum_sizes_sqroot(struct sum_struct *sum, int64 len)
        if (sum->count && DEBUG_GTE(DELTASUM, 2)) {
                rprintf(FINFO,
                        "count=%s rem=%ld blength=%ld s2length=%d flength=%s\n",
-                       big_num(sum->count, 0), (long)sum->remainder, (long)sum->blength,
-                       sum->s2length, big_num(sum->flength, 0));
+                       big_num(sum->count), (long)sum->remainder, (long)sum->blength,
+                       sum->s2length, big_num(sum->flength));
        }
 }
 
@@ -859,7 +860,7 @@ static int generate_and_send_sums(int fd, OFF_T len, int f_out, int f_copy)
                if (DEBUG_GTE(DELTASUM, 3)) {
                        rprintf(FINFO,
                                "chunk[%s] offset=%s len=%ld sum1=%08lx\n",
-                               big_num(i, 0), big_num(offset - n1, 0), (long)n1,
+                               big_num(i), big_num(offset - n1), (long)n1,
                                (unsigned long)sum1);
                }
                write_int(f_out, sum1);
@@ -1200,6 +1201,7 @@ static void list_file_entry(struct file_struct *f)
 {
        char permbuf[PERMSTRING_SIZE];
        int64 len;
+       int colwidth = human_readable ? 14 : 11;
 
        if (!F_IS_ACTIVE(f)) {
                /* this can happen if duplicate names were removed */
@@ -1213,15 +1215,16 @@ static void list_file_entry(struct file_struct *f)
 
 #ifdef SUPPORT_LINKS
        if (preserve_links && S_ISLNK(f->mode)) {
-               rprintf(FINFO, "%s %11s %s %s -> %s\n",
-                       permbuf, big_num(len, 0), timestring(f->modtime),
-                       f_name(f, NULL), F_SYMLINK(f));
+               rprintf(FINFO, "%s %*s %s %s -> %s\n",
+                       permbuf, colwidth, comma_num(len),
+                       timestring(f->modtime), f_name(f, NULL),
+                       F_SYMLINK(f));
        } else
 #endif
        {
-               rprintf(FINFO, "%s %11s %s %s\n",
-                       permbuf, big_num(len, 0), timestring(f->modtime),
-                       f_name(f, NULL));
+               rprintf(FINFO, "%s %*s %s %s\n",
+                       permbuf, colwidth, comma_num(len),
+                       timestring(f->modtime), f_name(f, NULL));
        }
 }
 
@@ -1906,7 +1909,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
 
        if (DEBUG_GTE(DELTASUM, 3)) {
                rprintf(FINFO, "gen mapped %s of size %s\n",
-                       fnamecmp, big_num(sx.st.st_size, 0));
+                       fnamecmp, big_num(sx.st.st_size));
        }
 
        if (DEBUG_GTE(DELTASUM, 2))
@@ -2077,8 +2080,7 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
        while (1) {
 #ifdef SUPPORT_HARD_LINKS
                if (preserve_hard_links && (ndx = get_hlink_num()) != -1) {
-                       flist = flist_for_ndx(ndx);
-                       assert(flist != NULL);
+                       flist = flist_for_ndx(ndx, "check_for_finished_files.1");
                        file = flist->files[ndx - flist->ndx_start];
                        assert(file->flags & FLAG_HLINKED);
                        finish_hard_link(file, f_name(file, fbuf), ndx, NULL, itemizing, code, -1);
@@ -2101,7 +2103,7 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
                        ignore_times++;
 
                        flist = cur_flist;
-                       cur_flist = flist_for_ndx(ndx);
+                       cur_flist = flist_for_ndx(ndx, "check_for_finished_files.2");
 
                        file = cur_flist->files[ndx - cur_flist->ndx_start];
                        if (solo_file)
@@ -2237,10 +2239,6 @@ void generate_files(int f_out, const char *local_name)
                                                dirdev = MAKEDEV(DEV_MAJOR(devp), DEV_MINOR(devp));
                                        } else
                                                dirdev = MAKEDEV(0, 0);
-                                       /* We must be sure we've had a chance to receive an I/O
-                                        * error for this directory before we delete in it. */
-                                       while (check_for_io_err && !cur_flist->next)
-                                               wait_for_receiver();
                                        delete_in_dir(fbuf, fp, &dirdev);
                                } else
                                        change_local_filter_dir(fbuf, strlen(fbuf), F_DEPTH(fp));