Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f8db4a8
)
A slight improvement to the logic in try_dests_non().
author
Wayne Davison
<wayned@samba.org>
Tue, 18 Apr 2006 05:24:02 +0000
(
05:24
+0000)
committer
Wayne Davison
<wayned@samba.org>
Tue, 18 Apr 2006 05:24:02 +0000
(
05:24
+0000)
generator.c
patch
|
blob
|
blame
|
history
diff --git
a/generator.c
b/generator.c
index
40159f9
..
3eef9e5
100644
(file)
--- a/
generator.c
+++ b/
generator.c
@@
-712,8
+712,14
@@
static int try_dests_non(struct file_struct *file, char *fname, int ndx,
if (link_stat(fnamebuf, &st, 0) < 0 || S_ISDIR(st.st_mode)
|| !unchanged_attrs(file, &st))
continue;
if (link_stat(fnamebuf, &st, 0) < 0 || S_ISDIR(st.st_mode)
|| !unchanged_attrs(file, &st))
continue;
+ if (IS_DEVICE(file->mode)) {
+ if (!IS_DEVICE(st.st_mode) || st.st_rdev != file->u.rdev)
+ continue;
+ } else if (IS_SPECIAL(file->mode)) {
+ if (!IS_SPECIAL(st.st_mode) || st.st_rdev != file->u.rdev)
+ continue;
#ifdef CAN_HARDLINK_SYMLINK
#ifdef CAN_HARDLINK_SYMLINK
- if (S_ISLNK(file->mode)) {
+
} else
if (S_ISLNK(file->mode)) {
#ifdef SUPPORT_LINKS
char lnk[MAXPATHLEN];
int len;
#ifdef SUPPORT_LINKS
char lnk[MAXPATHLEN];
int len;
@@
-723,12
+729,13
@@
static int try_dests_non(struct file_struct *file, char *fname, int ndx,
if (strcmp(lnk, file->u.link) != 0)
#endif
continue;
if (strcmp(lnk, file->u.link) != 0)
#endif
continue;
- } else
#endif
#endif
- if (IS_DEVICE(st.st_mode) != IS_DEVICE(file->mode)
- || IS_SPECIAL(st.st_mode) != IS_SPECIAL(file->mode)
- || st.st_rdev != file->u.rdev)
- continue;
+ } else {
+ rprintf(FERROR,
+ "internal: try_dests_non() called with invalid mode (%o)\n",
+ file->mode);
+ exit_cleanup(RERR_UNSUPPORTED);
+ }
if (link_dest) {
if (do_link(fnamebuf, fname) < 0) {
rsyserr(FERROR, errno,
if (link_dest) {
if (do_link(fnamebuf, fname) < 0) {
rsyserr(FERROR, errno,