rsync: race condition can cause loss of diagnostic output

Dick Streefland dick.streefland at altium.nl
Tue May 28 08:16:01 EST 2002


On Wednesday 2002-05-22 19:00, Charles C. Fu ?????? wrote:
| [This is a copy of the contents of Debian bug report #147842.]

This looks like the same race condition that I reported to the rsync
mailing list on 2002-05-16. The following patch fixes my problem:

--- rsync-2.5.5/log.c.orig	Mon Feb 18 20:51:12 2002
+++ rsync-2.5.5/log.c	Wed May 15 16:12:18 2002
@@ -116,7 +116,12 @@
 		int n = write(log_error_fd, el->buf+el->written, el->len - el->written);
 		/* don't check for an error if the best way of handling the error is
 		   to ignore it */
-		if (n == -1) break;
+		if (n == -1) {
+			if (errno == EAGAIN) {
+				msleep(20);
+			}
+			break;
+		}
 		if (n > 0) {
 			el->written += n;
 		}

-- 
Dick Streefland                      ////             Altium Software BV
dick.streefland at altium.nl           (@ @)          http://www.altium.com
--------------------------------oOO--(_)--OOo---------------------------




More information about the rsync mailing list