X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/719985cb9ce1d4866c47b155194a3968ae58541a..ba2133d6add082b059728074febdac6c520a4351:/hlink.c diff --git a/hlink.c b/hlink.c index 9919e924..010389db 100644 --- a/hlink.c +++ b/hlink.c @@ -4,12 +4,11 @@ * Copyright (C) 1996 Andrew Tridgell * Copyright (C) 1996 Paul Mackerras * Copyright (C) 2002 Martin Pool - * Copyright (C) 2004, 2005, 2006 Wayne Davison + * Copyright (C) 2004-2007 Wayne Davison * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -33,12 +32,12 @@ extern int remove_source_files; extern int stdout_format_has_i; extern int maybe_ATTRS_REPORT; extern char *basis_dir[]; -extern struct file_list *the_file_list; +extern struct file_list *cur_flist; #ifdef SUPPORT_HARD_LINKS #define HASH_LOAD_LIMIT(size) ((size)*3/4) -#define FPTR(i) (the_file_list->files[i]) +#define FPTR(i) (cur_flist->files[i]) struct ihash_table { int32 size; @@ -251,10 +250,10 @@ void match_hard_links(void) int i, ndx_count = 0; int32 *ndx_list; - if (!(ndx_list = new_array(int32, the_file_list->count))) + if (!(ndx_list = new_array(int32, cur_flist->count))) out_of_memory("match_hard_links"); - for (i = 0; i < the_file_list->count; i++) { + for (i = 0; i < cur_flist->count; i++) { if (F_IS_HLINKED(FPTR(i))) ndx_list[ndx_count++] = i; } @@ -285,7 +284,7 @@ static int maybe_hard_link(struct file_struct *file, int ndx, file->flags |= FLAG_HLINK_DONE; return 0; } - if (make_backups) { + if (make_backups > 0) { if (!make_backup(fname)) return -1; } else if (robust_unlink(fname)) { @@ -322,13 +321,13 @@ int hard_link_check(struct file_struct *file, int ndx, const char *fname, /* Is the previous link is not complete yet? */ if (!(prev_file->flags & FLAG_HLINK_DONE)) { /* Is the previous link being transferred? */ - if (prev_file->flags & FLAG_SENT) { + if (prev_file->flags & FLAG_FILE_SENT) { /* Add ourselves to the list of files that will be * updated when the transfer completes, and mark * ourself as waiting for the transfer. */ F_HL_PREV(file) = F_HL_PREV(prev_file); F_HL_PREV(prev_file) = ndx; - file->flags |= FLAG_SENT; + file->flags |= FLAG_FILE_SENT; return 1; } return 0;