Latest rZync release: 0.06

Wayne Davison wayned at users.sourceforge.net
Wed Jun 26 10:47:03 EST 2002


On Wed, 26 Jun 2002, Wayne Davison wrote:
> There are still unsquashed bugs lurking, so be careful.  For instance, I
> tried to copy my .mozilla dir, and the huge Cache hierarchy is currently
> giving it grief.  I'll debug this problem next.

Turned out to be a silly oversight on a realloc of some directory data.
Applying the following patch fixes things right up.

..wayne..

---8<------8<------8<------8<---cut here--->8------>8------>8------>8---
Index: flist.c
--- flist.c	26 Jun 2002 08:45:21 -0000	1.15
+++ flist.c	26 Jun 2002 17:41:45 -0000
@@ -52,10 +52,14 @@
 	}
 	len = strlen(fn);
 	if (bp-flist_data + len + 1 > flist_data_size) {
-	    int blen = bp - flist_data;
+	    uchar *old_data = flist_data;
 	    flist_data_size *= 2;
 	    flist_data = do_realloc(flist_data, flist_data_size);
-	    bp = flist_data + blen;
+	    if (flist_data != old_data) {
+		for (j = 0; j < cnt; j++)
+		    flist_ptrs[j] += flist_data - old_data;
+		bp += flist_data - old_data;
+	    }
 	}
 	memcpy(bp, fn, len + 1);
 	flist_ptrs[cnt++] = bp;
@@ -95,8 +99,10 @@
 	    continue; // XXX ignore devices for now!
 	}
 	if (bp - compressed_data + PATH_MAX*2 > compressed_data_size) {
+	    int blen = bp - compressed_data;
 	    compressed_data_size += 4*1024;
 	    compressed_data = do_realloc(compressed_data, compressed_data_size);
+	    bp = compressed_data + blen;
 	}
 	len = strlen(fn);
 	populate_attrs(&attrs, &sb);
---8<------8<------8<------8<---cut here--->8------>8------>8------>8---





More information about the rsync mailing list