Fixed some failing hunks.
[rsync/rsync-patches.git] / threaded-receiver.diff
index 07b9131..6cdf480 100644 (file)
@@ -50,7 +50,17 @@ Be sure to run "make proto" before running "make".
        if (cleanup_pid && cleanup_pid == getpid()) {
                char *pidf = lp_pid_file();
                if (pidf && *pidf)
---- orig/generator.c   2005-11-12 20:31:04
+--- orig/errcode.h     2005-12-16 23:48:43
++++ errcode.h  2005-12-16 23:50:02
+@@ -37,7 +37,6 @@
+ #define RERR_CRASHED    15      /* sibling crashed */
+ #define RERR_TERMINATED 16      /* sibling terminated abnormally */
+-#define RERR_SIGNAL1    19      /* status returned when sent SIGUSR1 */
+ #define RERR_SIGNAL     20      /* status returned when sent SIGINT, SIGTERM, SIGHUP */
+ #define RERR_WAITCHILD  21      /* some error returned by waitpid() */
+ #define RERR_MALLOC     22      /* error allocating core memory buffers */
+--- orig/generator.c   2005-12-16 04:03:06
 +++ generator.c        2005-12-08 23:17:08
 @@ -65,7 +65,6 @@ extern OFF_T min_size;
  extern int io_error;
@@ -60,9 +70,9 @@ Be sure to run "make proto" before running "make".
  extern int protocol_version;
  extern int fuzzy_basis;
  extern int always_checksum;
-@@ -94,6 +93,11 @@ extern struct filter_list_struct server_
- static int deletion_count = 0; /* used to implement --max-delete */
+@@ -96,6 +95,11 @@ static int deletion_count = 0; /* used t
+ static int can_link_symlinks = 1; /* start out optimistic */
+ static int can_link_devices = 1;
  
 +/* These vars are local copies so that the receiver can use the originals. */
 +static int GEN_append_mode;
@@ -72,7 +82,7 @@ Be sure to run "make proto" before running "make".
  /* For calling delete_file() */
  #define DEL_FORCE_RECURSE     (1<<1) /* recurse even w/o --force */
  #define DEL_TERSE             (1<<3)
-@@ -446,8 +450,8 @@ static void sum_sizes_sqroot(struct sum_
+@@ -445,8 +449,8 @@ static void sum_sizes_sqroot(struct sum_
        }
  
        if (protocol_version < 27) {
@@ -83,7 +93,7 @@ Be sure to run "make proto" before running "make".
                s2length = SUM_LENGTH;
        } else {
                int32 c;
-@@ -457,7 +461,7 @@ static void sum_sizes_sqroot(struct sum_
+@@ -456,7 +460,7 @@ static void sum_sizes_sqroot(struct sum_
                for (c = blength; c >>= 1 && b; b--) {}
                /* add a bit, subtract rollsum, round up. */
                s2length = (b + 1 - 32 + 7) / 8; /* --optimize in compiler-- */
@@ -92,7 +102,7 @@ Be sure to run "make proto" before running "make".
                s2length = MIN(s2length, SUM_LENGTH);
        }
  
-@@ -491,7 +495,7 @@ static void generate_and_send_sums(int f
+@@ -490,7 +494,7 @@ static void generate_and_send_sums(int f
        sum_sizes_sqroot(&sum, len);
        write_sum_head(f_out, &sum);
  
@@ -101,7 +111,7 @@ Be sure to run "make proto" before running "make".
                return;
  
        if (len > 0)
-@@ -510,7 +514,7 @@ static void generate_and_send_sums(int f
+@@ -509,7 +513,7 @@ static void generate_and_send_sums(int f
  
                if (f_copy >= 0) {
                        full_write(f_copy, map, n1);
@@ -110,7 +120,7 @@ Be sure to run "make proto" before running "make".
                                continue;
                }
  
-@@ -1063,7 +1067,7 @@ static void recv_generator(char *fname, 
+@@ -1143,7 +1147,7 @@ static void recv_generator(char *fname, 
                return;
        }
  
@@ -118,8 +128,8 @@ Be sure to run "make proto" before running "make".
 +      if (GEN_append_mode && st.st_size > file->length)
                return;
  
-       if (!compare_dest && fnamecmp_type <= FNAMECMP_BASIS_DIR_HIGH)
-@@ -1124,7 +1128,7 @@ static void recv_generator(char *fname, 
+       if (fnamecmp_type <= FNAMECMP_BASIS_DIR_HIGH)
+@@ -1198,7 +1202,7 @@ static void recv_generator(char *fname, 
                goto notify_others;
        }
  
@@ -128,7 +138,7 @@ Be sure to run "make proto" before running "make".
                if (!(backupptr = get_backup_name(fname))) {
                        close(fd);
                        return;
-@@ -1214,7 +1218,10 @@ void generate_files(int f_out, struct fi
+@@ -1288,7 +1292,10 @@ void generate_files(int f_out, struct fi
        int save_ignore_existing = ignore_existing;
        int save_ignore_non_existing = ignore_non_existing;
        int save_do_progress = do_progress;
@@ -140,7 +150,7 @@ Be sure to run "make proto" before running "make".
  
        if (protocol_version >= 29) {
                itemizing = 1;
-@@ -1243,7 +1250,7 @@ void generate_files(int f_out, struct fi
+@@ -1317,7 +1324,7 @@ void generate_files(int f_out, struct fi
                do_delete_pass(flist);
        do_progress = 0;
  
@@ -149,7 +159,7 @@ Be sure to run "make proto" before running "make".
                whole_file = 0;
        if (verbose >= 2) {
                rprintf(FINFO, "delta-transmission %s\n",
-@@ -1252,12 +1259,6 @@ void generate_files(int f_out, struct fi
+@@ -1326,12 +1333,6 @@ void generate_files(int f_out, struct fi
                        : "enabled");
        }
  
@@ -162,7 +172,7 @@ Be sure to run "make proto" before running "make".
        for (i = 0; i < flist->count; i++) {
                struct file_struct *file = flist->files[i];
  
-@@ -1301,23 +1302,34 @@ void generate_files(int f_out, struct fi
+@@ -1375,23 +1376,34 @@ void generate_files(int f_out, struct fi
                delete_in_dir(NULL, NULL, NULL);
  
        phase++;
@@ -203,7 +213,7 @@ Be sure to run "make proto" before running "make".
                if (local_name)
                        strlcpy(fbuf, local_name, sizeof fbuf);
                else
-@@ -1329,27 +1341,43 @@ void generate_files(int f_out, struct fi
+@@ -1403,27 +1415,43 @@ void generate_files(int f_out, struct fi
        phase++;
        ignore_non_existing = save_ignore_non_existing;
        ignore_existing = save_ignore_existing;
@@ -695,8 +705,8 @@ Be sure to run "make proto" before running "make".
 -      write_batch_monitor_out = -1;
 -      write_batch_monitor_in = -1;
 -}
---- orig/log.c 2005-10-26 16:49:08
-+++ log.c      2005-12-08 23:17:09
+--- orig/log.c 2005-12-16 23:48:44
++++ log.c      2005-12-16 23:49:57
 @@ -35,7 +35,6 @@ extern int am_sender;
  extern int local_server;
  extern int quiet;
@@ -704,17 +714,16 @@ Be sure to run "make proto" before running "make".
 -extern int msg_fd_out;
  extern int protocol_version;
  extern int preserve_times;
- extern int log_format_has_o_or_i;
-@@ -67,7 +66,7 @@ struct {
+ extern int log_format_has_i;
+@@ -68,7 +67,6 @@ struct {
        { RERR_IPC        , "error in IPC code" },
        { RERR_CRASHED    , "sibling process crashed" },
        { RERR_TERMINATED , "sibling process terminated abnormally" },
--      { RERR_SIGNAL     , "received SIGUSR1 or SIGINT" },
-+      { RERR_SIGNAL     , "received SIGINT, SIGHUP, or SIGTERM" },
+-      { RERR_SIGNAL1    , "received SIGUSR1" },
+       { RERR_SIGNAL     , "received SIGINT, SIGTERM, or SIGHUP" },
        { RERR_WAITCHILD  , "waitpid() failed" },
        { RERR_MALLOC     , "error allocating core memory buffers" },
-       { RERR_PARTIAL    , "some files could not be transferred" },
-@@ -204,8 +203,8 @@ void rwrite(enum logcode code, char *buf
+@@ -206,8 +204,8 @@ void rwrite(enum logcode code, char *buf
  
        buf[len] = 0;
  
@@ -725,8 +734,8 @@ Be sure to run "make proto" before running "make".
                send_msg((enum msgcode)code, buf, len);
                return;
        }
---- orig/main.c        2005-12-15 07:55:39
-+++ main.c     2005-12-10 19:02:56
+--- orig/main.c        2005-12-16 23:48:44
++++ main.c     2005-12-16 23:50:33
 @@ -30,7 +30,6 @@ extern int list_only;
  extern int am_root;
  extern int am_server;
@@ -900,7 +909,7 @@ Be sure to run "make proto" before running "make".
 -
 -static RETSIGTYPE sigusr1_handler(UNUSED(int val))
 -{
--      exit_cleanup(RERR_SIGNAL);
+-      exit_cleanup(RERR_SIGNAL1);
 -}
 -
 -static RETSIGTYPE sigusr2_handler(UNUSED(int val))
@@ -963,7 +972,7 @@ Be sure to run "make proto" before running "make".
                                show_progress(last_match, buf->file_size);
                        sum_update(map_ptr(buf, last_match, len), len);
                        last_match = s->flength;
---- orig/options.c     2005-11-15 18:21:22
+--- orig/options.c     2005-12-16 23:48:44
 +++ options.c  2005-12-08 23:17:09
 @@ -69,7 +69,6 @@ int def_compress_level = Z_DEFAULT_COMPR
  int am_root = 0;
@@ -981,7 +990,7 @@ Be sure to run "make proto" before running "make".
  int keep_partial = 0;
  int safe_symlinks = 0;
  int copy_unsafe_links = 0;
-@@ -1232,6 +1232,7 @@ int parse_arguments(int *argc, const cha
+@@ -1236,6 +1236,7 @@ int parse_arguments(int *argc, const cha
        if ((do_progress || dry_run) && !verbose && !log_before_transfer
            && !am_server)
                verbose = 1;
@@ -1150,9 +1159,9 @@ Be sure to run "make proto" before running "make".
 -      return am_sender ? "sender" : am_generator ? "generator" : "receiver";
 +      return am_sender ? "sender" : am_generator() ? "generator" : "receiver";
  }
---- orig/rsync.h       2005-11-12 20:31:04
+--- orig/rsync.h       2005-12-15 23:00:49
 +++ rsync.h    2005-12-10 19:02:58
-@@ -166,10 +166,8 @@ enum msgcode {
+@@ -165,10 +165,8 @@ enum msgcode {
        MSG_DATA=0,     /* raw data on the multiplexed stream */
        MSG_ERROR=FERROR, MSG_INFO=FINFO, /* remote logging */
        MSG_LOG=FLOG, MSG_FCLIENT=FCLIENT, /* sibling logging */
@@ -1163,7 +1172,7 @@ Be sure to run "make proto" before running "make".
  };
  
  #include "errcode.h"
-@@ -320,6 +318,7 @@ enum msgcode {
+@@ -319,6 +317,7 @@ enum msgcode {
  #endif
  
  #include <assert.h>