--- embedaddon/rsync/util.c 2012/02/17 15:09:30 1.1.1.1 +++ embedaddon/rsync/util.c 2013/07/22 00:20:21 1.1.1.1.2.1 @@ -1168,7 +1168,7 @@ int handle_partial_dir(const char *fname, int create) } statret = -1; } - if (statret < 0 && do_mkdir(dir, 0700) < 0) { + if (statret < 0 && do_mkdir_path(dir, 0700) < 0) { *fn = '/'; return 0; } @@ -1177,6 +1177,32 @@ int handle_partial_dir(const char *fname, int create) *fn = '/'; return 1; +} + +/* We need to supply our own strcmp function for file list comparisons + * to ensure that signed/unsigned usage is consistent between machines. */ +int u_strcmp(const char *p1, const char *p2) +{ + for ( ; *p1; p1++, p2++) { + if (*p1 != *p2) + break; + } + + return (int)*(uchar*)p1 - (int)*(uchar*)p2; +} + +/* We need a memcmp function compares unsigned-byte values. */ +int u_memcmp(const void *p1, const void *p2, size_t len) +{ + const uchar *u1 = p1; + const uchar *u2 = p2; + + while (len--) { + if (*u1 != *u2) + return (int)*u1 - (int)*u2; + } + + return 0; } /* Determine if a symlink points outside the current directory tree.