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:
77b013a
)
Fixed a bug where special files were not getting hard-linked via
author
Wayne Davison
<wayned@samba.org>
Mon, 17 Apr 2006 19:53:41 +0000
(19:53 +0000)
committer
Wayne Davison
<wayned@samba.org>
Mon, 17 Apr 2006 19:53:41 +0000
(19:53 +0000)
the --link-dest option.
generator.c
patch
|
blob
|
blame
|
history
diff --git
a/generator.c
b/generator.c
index
518f49e
..
40159f9
100644
(file)
--- a/
generator.c
+++ b/
generator.c
@@
-703,27
+703,32
@@
static int try_dests_non(struct file_struct *file, char *fname, int ndx,
int itemizing, int maybe_ATTRS_REPORT,
enum logcode code)
{
int itemizing, int maybe_ATTRS_REPORT,
enum logcode code)
{
- char fnamebuf[MAXPATHLEN]
, lnk[MAXPATHLEN]
;
+ char fnamebuf[MAXPATHLEN];
STRUCT_STAT st;
STRUCT_STAT st;
- int
len,
i = 0;
+ int i = 0;
do {
pathjoin(fnamebuf, MAXPATHLEN, basis_dir[i], fname);
if (link_stat(fnamebuf, &st, 0) < 0 || S_ISDIR(st.st_mode)
|| !unchanged_attrs(file, &st))
continue;
do {
pathjoin(fnamebuf, MAXPATHLEN, basis_dir[i], fname);
if (link_stat(fnamebuf, &st, 0) < 0 || S_ISDIR(st.st_mode)
|| !unchanged_attrs(file, &st))
continue;
+#ifdef CAN_HARDLINK_SYMLINK
if (S_ISLNK(file->mode)) {
#ifdef SUPPORT_LINKS
if (S_ISLNK(file->mode)) {
#ifdef SUPPORT_LINKS
+ char lnk[MAXPATHLEN];
+ int len;
if ((len = readlink(fnamebuf, lnk, MAXPATHLEN-1)) <= 0)
continue;
lnk[len] = '\0';
if (strcmp(lnk, file->u.link) != 0)
#endif
continue;
if ((len = readlink(fnamebuf, lnk, MAXPATHLEN-1)) <= 0)
continue;
lnk[len] = '\0';
if (strcmp(lnk, file->u.link) != 0)
#endif
continue;
- } else {
- if (!IS_DEVICE(st.st_mode) || st.st_rdev != file->u.rdev)
- continue;
- }
+ } else
+#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;
if (link_dest) {
if (do_link(fnamebuf, fname) < 0) {
rsyserr(FERROR, errno,
if (link_dest) {
if (do_link(fnamebuf, fname) < 0) {
rsyserr(FERROR, errno,