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
The debug output for add_exclude() now needs to limit the pattern to
[rsync/rsync.git]
/
hlink.c
diff --git
a/hlink.c
b/hlink.c
index
f42df53
..
3ee8433
100644
(file)
--- a/
hlink.c
+++ b/
hlink.c
@@
-22,6
+22,7
@@
extern int dry_run;
extern int verbose;
extern int dry_run;
extern int verbose;
+extern int make_backups;
#if SUPPORT_HARD_LINKS
static int hlink_compare(struct file_struct **file1, struct file_struct **file2)
#if SUPPORT_HARD_LINKS
static int hlink_compare(struct file_struct **file1, struct file_struct **file2)
@@
-38,8
+39,8
@@
static int hlink_compare(struct file_struct **file1, struct file_struct **file2)
return file_compare(file1, file2);
}
return file_compare(file1, file2);
}
-struct file_struct **hlink_list;
-int hlink_count;
+st
atic st
ruct file_struct **hlink_list;
+
static
int hlink_count;
#define LINKED(p1,p2) ((p1)->F_DEV == (p2)->F_DEV \
&& (p1)->F_INODE == (p2)->F_INODE)
#define LINKED(p1,p2) ((p1)->F_DEV == (p2)->F_DEV \
&& (p1)->F_INODE == (p2)->F_INODE)
@@
-134,7
+135,7
@@
void init_hard_links(struct file_list *flist)
int hard_link_check(struct file_struct *file, int skip)
{
int hard_link_check(struct file_struct *file, int skip)
{
- if (!file->link_u.links)
+ if (!
hlink_list || !
file->link_u.links)
return 0;
if (skip && !(file->flags & FLAG_HLINK_EOL))
hlink_list[file->F_HLINDEX] = file->F_NEXT;
return 0;
if (skip && !(file->flags & FLAG_HLINK_EOL))
hlink_list[file->F_HLINDEX] = file->F_NEXT;
@@
-190,7
+191,10
@@
void do_hard_links(void)
if (st2.st_dev == st1.st_dev
&& st2.st_ino == st1.st_ino)
continue;
if (st2.st_dev == st1.st_dev
&& st2.st_ino == st1.st_ino)
continue;
- if (robust_unlink(hlink2)) {
+ if (make_backups) {
+ if (!make_backup(hlink2))
+ continue;
+ } else if (robust_unlink(hlink2)) {
if (verbose > 0) {
rprintf(FINFO,
"unlink %s failed: %s\n",
if (verbose > 0) {
rprintf(FINFO,
"unlink %s failed: %s\n",