static void output_flist(struct file_list *flist);
void init_flist(void)
-@@ -350,6 +363,238 @@ static void flist_done_allocating(struct file_list *flist)
+@@ -338,6 +351,238 @@ static void flist_done_allocating(struct file_list *flist)
flist->pool_boundary = ptr;
}
+ file_checksum(fname, stp->st_size, sum_buf);
+}
+
- int push_pathname(const char *dir, int len)
- {
- if (dir == pathname)
+ /* Call this with EITHER (1) "file, NULL, 0" to chdir() to the file's
+ * F_PATHNAME(), or (2) "NULL, dir, dirlen" to chdir() to the supplied dir,
+ * with dir == NULL taken to be the starting directory, and dirlen < 0
@@ -1010,7 +1255,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
STRUCT_STAT *stp, int flags, int filter_level)
{
struct file_struct *file;
char thisname[MAXPATHLEN];
char linkname[MAXPATHLEN];
-@@ -1149,9 +1394,16 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1160,9 +1405,16 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
memcpy(lastdir, thisname, len);
lastdir[len] = '\0';
lastdir_len = len;
basename_len = strlen(basename) + 1; /* count the '\0' */
#ifdef SUPPORT_LINKS
-@@ -1224,14 +1476,18 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1235,14 +1487,18 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
memcpy(bp + basename_len, linkname, linkname_len);
#endif
/* This code is only used by the receiver when it is building
* a list of files for a delete pass. */
if (keep_dirlinks && linkname_len && flist) {
-@@ -2147,7 +2403,8 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -2155,7 +2411,8 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
* file-list to check if this is a 1-file xfer. */
send_extra_file_list(f, 1);
}
return flist;
}
-@@ -2249,7 +2506,7 @@ struct file_list *recv_file_list(int f)
+@@ -2257,7 +2514,7 @@ struct file_list *recv_file_list(int f)
else if (f >= 0)
recv_id_list(f, flist);
if (protocol_version < 30) {
/* Recv the io_error flag */
-@@ -2447,7 +2704,7 @@ void flist_free(struct file_list *flist)
+@@ -2455,7 +2712,7 @@ void flist_free(struct file_list *flist)
/* This routine ensures we don't have any duplicate names in our file list.
* duplicate names can cause corruption because of the pipelining. */
{
char fbuf[MAXPATHLEN];
int i, prev_i;
-@@ -2498,7 +2755,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -2506,7 +2763,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
/* If one is a dir and the other is not, we want to
* keep the dir because it might have contents in the
* list. Otherwise keep the first one. */
struct file_struct *fp = flist->sorted[j];
if (!S_ISDIR(fp->mode))
keep = i, drop = j;
-@@ -2514,8 +2771,8 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -2522,8 +2779,8 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
} else
keep = j, drop = i;
rprintf(FINFO,
"removing duplicate name %s from file list (%d)\n",
f_name(file, fbuf), drop + flist->ndx_start);
-@@ -2537,7 +2794,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -2545,7 +2802,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
}
flist->high = prev_i;
}
statret = link_stat(fname, &sx.st, keep_dirlinks && is_dir);
-@@ -1776,7 +1785,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1775,7 +1784,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
;
else if (fnamecmp_type == FNAMECMP_FUZZY)
;
diff --git a/rsync.h b/rsync.h
--- a/rsync.h
+++ b/rsync.h
-@@ -682,6 +682,10 @@ extern int xattrs_ndx;
+@@ -686,6 +686,10 @@ extern int xattrs_ndx;
#define F_SUM(f) ((char*)OPT_EXTRA(f, LEN64_BUMP(f) + HLINK_BUMP(f) \
+ SUM_EXTRA_CNT - 1))
/* Some utility defines: */
#define F_IS_ACTIVE(f) (f)->basename[0]
#define F_IS_HLINKED(f) ((f)->flags & FLAG_HLINKED)
-@@ -860,6 +864,13 @@ typedef struct {
+@@ -864,6 +868,13 @@ typedef struct {
char fname[1]; /* has variable size */
} relnamecache;