summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backup.c3
-rw-r--r--generator.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/backup.c b/backup.c
index 90676f98..dd1b3dd0 100644
--- a/backup.c
+++ b/backup.c
@@ -265,7 +265,8 @@ static int keep_backup(char *fname)
kept = 1;
}
#endif
- if (!kept && preserve_hard_links && check_hard_link(file)) {
+ if (!kept && preserve_hard_links && file->link_u.links
+ && file->F_HEAD != file) {
if (verbose > 1)
rprintf(FINFO, "%s is a hard link\n", f_name(file));
}
diff --git a/generator.c b/generator.c
index da532239..5126f281 100644
--- a/generator.c
+++ b/generator.c
@@ -397,7 +397,7 @@ void recv_generator(char *fname, struct file_struct *file, int i, int f_out)
}
#endif
- if (preserve_hard_links && check_hard_link(file)) {
+ if (preserve_hard_links && file->link_u.links && file->F_HEAD != file) {
if (verbose > 1) {
rprintf(FINFO, "recv_generator: \"%s\" is a hard link\n",
f_name(file));