Got rid of the (unneeded) ./prepare_source instructions.
[rsync/rsync-patches.git] / threaded-receiver.diff
index 8a5ea35..d908d9a 100644 (file)
@@ -18,12 +18,6 @@ NOTE: we still need to duplicate the partial_fname static in util.c!
 If you try this out, please send some email to wayned@samba.org or the rsync
 mailing list with your results, build changes, bug reports, etc.  Thanks!
 
-After applying this patch, run these commands for a successful build:
-
-    ./prepare-source
-    ./configure                      (optional if already run)
-    make
-
 --- old/Makefile.in
 +++ new/Makefile.in
 @@ -7,7 +7,7 @@ exec_prefix=@exec_prefix@
@@ -49,24 +43,24 @@ After applying this patch, run these commands for a successful build:
   * Close all open sockets and files, allowing a (somewhat) graceful
   * shutdown() of socket connections.  This eliminates the abortive
 @@ -98,9 +94,6 @@ NORETURN void _exit_cleanup(int code, co
- {
-       int ocode = code;
+       static int exit_code = 0;
+       static int unmodified_code = 0;
  
 -      SIGACTION(SIGUSR1, SIG_IGN);
 -      SIGACTION(SIGUSR2, SIG_IGN);
 -
-       in_exit_cleanup = 1;
-       if (verbose > 3) {
-@@ -133,8 +126,6 @@ NORETURN void _exit_cleanup(int code, co
-       io_flush(FULL_FLUSH);
-       if (cleanup_fname)
-               do_unlink(cleanup_fname);
--      if (code)
--              kill_all(SIGUSR1);
-       if (cleanup_pid && cleanup_pid == getpid()) {
-               char *pidf = lp_pid_file();
-               if (pidf && *pidf)
+       if (exit_code) /* Preserve first error code when recursing. */
+               code = exit_code;
+@@ -157,8 +150,6 @@ NORETURN void _exit_cleanup(int code, co
+               if (cleanup_fname)
+                       do_unlink(cleanup_fname);
+-              if (code)
+-                      kill_all(SIGUSR1);
+               if (cleanup_pid && cleanup_pid == getpid()) {
+                       char *pidf = lp_pid_file();
+                       if (pidf && *pidf)
 --- old/errcode.h
 +++ new/errcode.h
 @@ -37,7 +37,6 @@
@@ -719,7 +713,8 @@ After applying this patch, run these commands for a successful build:
        }
  }
  
- void io_flush(int flush_it_all)
+-void io_flush(int flush_it_all)
++void io_flush(UNUSED(int flush_it_all))
  {
 -      msg2genr_flush(flush_it_all);
 -      msg2sndr_flush();
@@ -760,7 +755,7 @@ After applying this patch, run these commands for a successful build:
  extern int allow_8bit_chars;
  extern int protocol_version;
  extern int preserve_times;
-@@ -76,7 +75,6 @@ struct {
+@@ -75,7 +74,6 @@ struct {
        { RERR_IPC        , "error in IPC code" },
        { RERR_CRASHED    , "sibling process crashed" },
        { RERR_TERMINATED , "sibling process terminated abnormally" },
@@ -768,9 +763,9 @@ After applying this patch, run these commands for a successful build:
        { RERR_SIGNAL     , "received SIGINT, SIGTERM, or SIGHUP" },
        { RERR_WAITCHILD  , "waitpid() failed" },
        { RERR_MALLOC     , "error allocating core memory buffers" },
-@@ -250,8 +248,8 @@ void rwrite(enum logcode code, char *buf
+@@ -241,8 +239,8 @@ void rwrite(enum logcode code, char *buf
        if (len < 0)
-               EXIT_OR_RETURN(RERR_MESSAGEIO);
+               exit_cleanup(RERR_MESSAGEIO);
  
 -      if (am_server && msg_fd_out >= 0) {
 -              /* Pass the message to our sibling. */
@@ -1035,7 +1030,7 @@ After applying this patch, run these commands for a successful build:
  int keep_partial = 0;
  int safe_symlinks = 0;
  int copy_unsafe_links = 0;
-@@ -1299,6 +1299,7 @@ int parse_arguments(int *argc, const cha
+@@ -1302,6 +1302,7 @@ int parse_arguments(int *argc, const cha
  
        if (do_progress && !verbose && !log_before_transfer && !am_server)
                verbose = 1;