Output an FERROR* for a general io_error, and an FWARNING for other
[rsync/rsync.git] / generator.c
index 22f2851..5a57a0f 100644 (file)
@@ -74,7 +74,6 @@ extern int fuzzy_basis;
 extern int always_checksum;
 extern int checksum_len;
 extern char *partial_dir;
-extern char *basis_dir[];
 extern int compare_dest;
 extern int copy_dest;
 extern int link_dest;
@@ -94,6 +93,7 @@ extern uid_t our_uid;
 extern char *backup_dir;
 extern char *backup_suffix;
 extern int backup_suffix_len;
+extern char *basis_dir[MAX_BASIS_DIRS+1];
 extern struct file_list *cur_flist, *first_flist, *dir_flist;
 extern struct filter_list_struct daemon_filter_list;
 
@@ -803,11 +803,11 @@ static void sum_sizes_sqroot(struct sum_struct *sum, int64 len)
        if ((int64)sum->count != l)
                sum->count = -1;
 
-       if (sum->count && DEBUG_GTE(CHKSUM, 2)) {
+       if (sum->count && DEBUG_GTE(DELTASUM, 2)) {
                rprintf(FINFO,
-                       "count=%.0f rem=%ld blength=%ld s2length=%d flength=%.0f\n",
-                       (double)sum->count, (long)sum->remainder, (long)sum->blength,
-                       sum->s2length, (double)sum->flength);
+                       "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));
        }
 }
 
@@ -855,10 +855,10 @@ static int generate_and_send_sums(int fd, OFF_T len, int f_out, int f_copy)
                sum1 = get_checksum1(map, n1);
                get_checksum2(map, n1, sum2);
 
-               if (DEBUG_GTE(CHKSUM, 3)) {
+               if (DEBUG_GTE(DELTASUM, 3)) {
                        rprintf(FINFO,
-                               "chunk[%.0f] offset=%.0f len=%ld sum1=%08lx\n",
-                               (double)i, (double)offset - n1, (long)n1,
+                               "chunk[%s] offset=%s len=%ld sum1=%08lx\n",
+                               big_num(i, 0), big_num(offset - n1, 0), (long)n1,
                                (unsigned long)sum1);
                }
                write_int(f_out, sum1);
@@ -1198,7 +1198,7 @@ static int try_dests_non(struct file_struct *file, char *fname, int ndx,
 static void list_file_entry(struct file_struct *f)
 {
        char permbuf[PERMSTRING_SIZE];
-       double len;
+       int64 len;
 
        if (!F_IS_ACTIVE(f)) {
                /* this can happen if duplicate names were removed */
@@ -1212,14 +1212,14 @@ static void list_file_entry(struct file_struct *f)
 
 #ifdef SUPPORT_LINKS
        if (preserve_links && S_ISLNK(f->mode)) {
-               rprintf(FINFO, "%s %11.0f %s %s -> %s\n",
-                       permbuf, len, timestring(f->modtime),
+               rprintf(FINFO, "%s %11s %s %s -> %s\n",
+                       permbuf, big_num(len, 0), timestring(f->modtime),
                        f_name(f, NULL), F_SYMLINK(f));
        } else
 #endif
        {
-               rprintf(FINFO, "%s %11.0f %s %s\n",
-                       permbuf, len, timestring(f->modtime),
+               rprintf(FINFO, "%s %11s %s %s\n",
+                       permbuf, big_num(len, 0), timestring(f->modtime),
                        f_name(f, NULL));
        }
 }
@@ -1903,12 +1903,12 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
                fnamecmp_type = FNAMECMP_BACKUP;
        }
 
-       if (DEBUG_GTE(CHKSUM, 3)) {
-               rprintf(FINFO, "gen mapped %s of size %.0f\n",
-                       fnamecmp, (double)sx.st.st_size);
+       if (DEBUG_GTE(DELTASUM, 3)) {
+               rprintf(FINFO, "gen mapped %s of size %s\n",
+                       fnamecmp, big_num(sx.st.st_size, 0));
        }
 
-       if (DEBUG_GTE(CHKSUM, 2))
+       if (DEBUG_GTE(DELTASUM, 2))
                rprintf(FINFO, "generating and sending sums for %d\n", ndx);
 
   notify_others:
@@ -2336,7 +2336,7 @@ void generate_files(int f_out, const char *local_name)
                touch_up_dirs(dir_flist, -1);
 
        if (max_delete >= 0 && deletion_count > max_delete) {
-               rprintf(FINFO,
+               rprintf(FWARNING,
                        "Deletions stopped due to --max-delete limit (%d skipped)\n",
                        deletion_count - max_delete);
                io_error |= IOERR_DEL_LIMIT;