Commit 77943e69 authored by Wayne Davison's avatar Wayne Davison

- Renamed updating_basis -> updating_basis_or_equiv.

- Set updating_basis_or_equiv if we're inplace-updating a
  file using the backup file as the basis.
parent d620219d
...@@ -60,7 +60,7 @@ extern struct filter_list_struct server_filter_list; ...@@ -60,7 +60,7 @@ extern struct filter_list_struct server_filter_list;
static struct bitbag *delayed_bits = NULL; static struct bitbag *delayed_bits = NULL;
static int phase = 0, redoing = 0; static int phase = 0, redoing = 0;
/* We're either updating the basis file or an identical copy: */ /* We're either updating the basis file or an identical copy: */
static int updating_basis; static int updating_basis_or_equiv;
/* /*
* get_tmpname() - create a tmp filename for a given filename * get_tmpname() - create a tmp filename for a given filename
...@@ -259,7 +259,7 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r, ...@@ -259,7 +259,7 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
sum_update(map, len); sum_update(map, len);
} }
if (updating_basis) { if (updating_basis_or_equiv) {
if (offset == offset2 && fd != -1) { if (offset == offset2 && fd != -1) {
OFF_T pos; OFF_T pos;
if (flush_write_file(fd) < 0) if (flush_write_file(fd) < 0)
...@@ -553,14 +553,18 @@ int recv_files(int f_in, char *local_name) ...@@ -553,14 +553,18 @@ int recv_files(int f_in, char *local_name)
break; break;
} }
if (!fnamecmp || (server_filter_list.head if (!fnamecmp || (server_filter_list.head
&& check_filter(&server_filter_list, fname, 0) < 0)) && check_filter(&server_filter_list, fname, 0) < 0)) {
fnamecmp = fname; fnamecmp = fname;
fnamecmp_type = FNAMECMP_FNAME;
}
} else { } else {
/* Reminder: --inplace && --partial-dir are never /* Reminder: --inplace && --partial-dir are never
* enabled at the same time. */ * enabled at the same time. */
if (inplace && make_backups > 0) { if (inplace && make_backups > 0) {
if (!(fnamecmp = get_backup_name(fname))) if (!(fnamecmp = get_backup_name(fname)))
fnamecmp = fname; fnamecmp = fname;
else
fnamecmp_type = FNAMECMP_BACKUP;
} else if (partial_dir && partialptr) } else if (partial_dir && partialptr)
fnamecmp = partialptr; fnamecmp = partialptr;
else else
...@@ -586,7 +590,9 @@ int recv_files(int f_in, char *local_name) ...@@ -586,7 +590,9 @@ int recv_files(int f_in, char *local_name)
fd1 = do_open(fnamecmp, O_RDONLY, 0); fd1 = do_open(fnamecmp, O_RDONLY, 0);
} }
} }
updating_basis = inplace && fnamecmp == fname;
updating_basis_or_equiv = inplace
&& (fnamecmp == fname || fnamecmp_type == FNAMECMP_BACKUP);
if (fd1 == -1) { if (fd1 == -1) {
st.st_mode = 0; st.st_mode = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment