X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/5d2a70713930e6c60788c728c8c6ae32f280ad84..9352b0649b8d6aa21d9d567c1d819a0fa26c7b01:/backup.c diff --git a/backup.c b/backup.c index 3f5c416e..c1b80834 100644 --- a/backup.c +++ b/backup.c @@ -25,6 +25,7 @@ extern int backup_suffix_len; extern int backup_dir_len; extern char *backup_suffix; extern char *backup_dir; +extern struct file_struct **hlink_list; extern int am_root; extern int preserve_devices; @@ -198,7 +199,7 @@ static int keep_backup(char *fname) if (do_stat(fname, &st)) return 1; #endif - file = make_file(fname, NULL, NO_EXCLUDES); + file = make_file(fname, NO_EXCLUDES); /* the file could have disappeared */ if (!file) return 1; @@ -263,7 +264,7 @@ static int keep_backup(char *fname) } #endif if (!kept && preserve_hard_links && file->link_u.links - && file->F_HEAD != file) { + && hlink_list[file->F_HLINDEX] != file) { if (verbose > 1) rprintf(FINFO, "%s is a hard link\n", f_name(file)); } @@ -281,8 +282,7 @@ static int keep_backup(char *fname) } } set_perms(keep_name, file, NULL, 0); - free_file(file); - free(file); + free_file(file, FREE_STRUCT); if (verbose > 1) rprintf(FINFO, "keep_backup %s -> %s\n", fname, keep_name);