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
Try a different tact to get cygwin to skip this test.
[rsync/rsync.git]
/
generator.c
diff --git
a/generator.c
b/generator.c
index
dd3eef6
..
f3849a0
100644
(file)
--- a/
generator.c
+++ b/
generator.c
@@
-41,6
+41,7
@@
extern int remote_version;
extern int always_checksum;
extern int modify_window;
extern char *compare_dest;
extern int always_checksum;
extern int modify_window;
extern char *compare_dest;
+extern int link_dest;
/* choose whether to skip a particular file */
/* choose whether to skip a particular file */
@@
-50,6
+51,15
@@
static int skip_file(char *fname,
if (st->st_size != file->length) {
return 0;
}
if (st->st_size != file->length) {
return 0;
}
+ if (link_dest) {
+ if((st->st_mode & ~_S_IFMT) != (file->mode & ~_S_IFMT)) {
+ return 0;
+ }
+ if (st->st_uid != file->uid || st->st_gid != file->gid) {
+ return 0;
+ }
+ }
+
/* if always checksum is set then we use the checksum instead
of the file time to determine whether to sync */
/* if always checksum is set then we use the checksum instead
of the file time to determine whether to sync */
@@
-356,6
+366,18
@@
void recv_generator(char *fname, struct file_list *flist, int i, int f_out)
statret = -1;
if (statret == -1)
errno = saveerrno;
statret = -1;
if (statret == -1)
errno = saveerrno;
+#if HAVE_LINK
+ else if (link_dest && !dry_run) {
+ if (do_link(fnamecmpbuf, fname) != 0) {
+ if (verbose > 0)
+ rprintf(FINFO,"link %s => %s : %s\n",
+ fnamecmpbuf,
+ fname,
+ strerror(errno));
+ }
+ fnamecmp = fnamecmpbuf;
+ }
+#endif
else
fnamecmp = fnamecmpbuf;
}
else
fnamecmp = fnamecmpbuf;
}