Hello,

It seems that bug with recursive calling of _exit_cleanup() is not fixed
in this version.
In log.c EPIPE is not hanled and this leads to recursive
_exit_cleanup(). First patch I've made for this looks like:

============== cut ==================
--- rsync-2.5.5/log.c   2002-02-18 20:51:12 +0100
+++ rsync-2.5.5.patch/log.c     2002-07-09 12:09:56 +0200
@@ -276,9 +276,11 @@
 
        if (!f) exit_cleanup(RERR_MESSAGEIO);
 
-       if (fwrite(buf, len, 1, f) != 1) exit_cleanup(RERR_MESSAGEIO);
-
-       if (buf[len-1] == '\r' || buf[len-1] == '\n') fflush(f);
+       if (fwrite(buf, len, 1, f) == 1) {
+               if (buf[len-1] == '\r' || buf[len-1] == '\n') fflush(f);
+       } else
+               if (errno!=EPIPE)
+                       exit_cleanup(RERR_MESSAGEIO);
 }


============== cut ==================

Later I've created other instead of first one. It handles all possible
cases of recursive calling of _exit_cleanup():

============== cut ==================
--- rsync-2.5.5/cleanup.c       2002-03-27 02:03:13 +0100
+++ rsync-2.5.5.cleanup/cleanup.c       2002-07-11 12:53:52 +0200
@@ -43,6 +43,11 @@
        int ocode = code;
        extern int keep_partial;
        extern int log_got_error;
+       static int inside_cleanup = 0;
+
+       if (inside_cleanup != 0)
+               return;
+       inside_cleanup = 1;
 
        signal(SIGUSR1, SIG_IGN);
        signal(SIGUSR2, SIG_IGN);
============== cut ==================

-- 
Sviatoslav Sviridoff
// Lintec Project/Minsk // PIN AG/Berlin //
-- 
He is a man capable of turning any colour into grey.
                -- John LeCarre 
-- 
To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.tuxedo.org/~esr/faqs/smart-questions.html

Reply via email to