Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Mention that sorting the --files-from input is helpful.
[rsync/rsync.git]
/
flist.c
diff --git
a/flist.c
b/flist.c
index
10fdc4c
..
4a50583
100644
(file)
--- a/
flist.c
+++ b/
flist.c
@@
-130,7
+130,7
@@
int flist_eof = 0; /* all the file-lists are now known */
* will survive just long enough to be used by send_file_entry(). */
static dev_t tmp_rdev;
#ifdef SUPPORT_HARD_LINKS
* will survive just long enough to be used by send_file_entry(). */
static dev_t tmp_rdev;
#ifdef SUPPORT_HARD_LINKS
-static int64 tmp_dev, tmp_ino;
+static int64 tmp_dev
= -1
, tmp_ino;
#endif
static char tmp_sum[MAX_DIGEST_LEN];
#endif
static char tmp_sum[MAX_DIGEST_LEN];
@@
-508,7
+508,7
@@
static void send_file_entry(int f, const char *fname, struct file_struct *file,
xflags |= XMIT_MOD_NSEC;
#ifdef SUPPORT_HARD_LINKS
xflags |= XMIT_MOD_NSEC;
#ifdef SUPPORT_HARD_LINKS
- if (tmp_dev !=
0
) {
+ if (tmp_dev !=
-1
) {
if (protocol_version >= 30) {
struct ht_int64_node *np = idev_find(tmp_dev, tmp_ino);
first_hlink_ndx = (int32)(long)np->data - 1;
if (protocol_version >= 30) {
struct ht_int64_node *np = idev_find(tmp_dev, tmp_ino);
first_hlink_ndx = (int32)(long)np->data - 1;
@@
-641,15
+641,17
@@
static void send_file_entry(int f, const char *fname, struct file_struct *file,
#endif
#ifdef SUPPORT_HARD_LINKS
#endif
#ifdef SUPPORT_HARD_LINKS
- if (tmp_dev != 0 && protocol_version < 30) {
+ if (tmp_dev != -1 && protocol_version < 30) {
+ /* Older protocols expect the dev number to be transmitted
+ * 1-incremented so that it is never zero. */
if (protocol_version < 26) {
/* 32-bit dev_t and ino_t */
if (protocol_version < 26) {
/* 32-bit dev_t and ino_t */
- write_int(f, (int32)
dev
);
+ write_int(f, (int32)
(dev+1)
);
write_int(f, (int32)tmp_ino);
} else {
/* 64-bit dev_t and ino_t */
if (!(xflags & XMIT_SAME_DEV_pre30))
write_int(f, (int32)tmp_ino);
} else {
/* 64-bit dev_t and ino_t */
if (!(xflags & XMIT_SAME_DEV_pre30))
- write_longint(f, dev);
+ write_longint(f, dev
+1
);
write_longint(f, tmp_ino);
}
}
write_longint(f, tmp_ino);
}
}
@@
-1341,10
+1343,10
@@
struct file_struct *make_file(const char *fname, struct file_list *flist,
if (protocol_version >= 28
? (!S_ISDIR(st.st_mode) && st.st_nlink > 1)
: S_ISREG(st.st_mode)) {
if (protocol_version >= 28
? (!S_ISDIR(st.st_mode) && st.st_nlink > 1)
: S_ISREG(st.st_mode)) {
- tmp_dev = (int64)st.st_dev
+ 1
;
+ tmp_dev = (int64)st.st_dev;
tmp_ino = (int64)st.st_ino;
} else
tmp_ino = (int64)st.st_ino;
} else
- tmp_dev =
0
;
+ tmp_dev =
-1
;
}
#endif
}
#endif
@@
-1564,12
+1566,6
@@
static void send_if_directory(int f, struct file_list *flist,
unsigned int len = strlen(fbuf);
if (len > 1 && fbuf[len-1] == '/')
fbuf[--len] = '\0';
unsigned int len = strlen(fbuf);
if (len > 1 && fbuf[len-1] == '/')
fbuf[--len] = '\0';
- if (len >= MAXPATHLEN - 1) {
- io_error |= IOERR_GENERAL;
- rprintf(FERROR_XFER, "skipping long-named directory: %s\n",
- full_fname(fbuf));
- return;
- }
save_filters = push_local_filters(fbuf, len);
send_directory(f, flist, fbuf, len, flags);
pop_local_filters(save_filters);
save_filters = push_local_filters(fbuf, len);
send_directory(f, flist, fbuf, len, flags);
pop_local_filters(save_filters);