- Set updating_basis_or_equiv if we're inplace-updating a
file using the backup file as the basis.
static struct bitbag *delayed_bits = NULL;
static int phase = 0, redoing = 0;
/* We're either updating the basis file or an identical copy: */
static struct bitbag *delayed_bits = NULL;
static int phase = 0, redoing = 0;
/* 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
+ if (updating_basis_or_equiv) {
if (offset == offset2 && fd != -1) {
OFF_T pos;
if (flush_write_file(fd) < 0)
if (offset == offset2 && fd != -1) {
OFF_T pos;
if (flush_write_file(fd) < 0)
break;
}
if (!fnamecmp || (server_filter_list.head
break;
}
if (!fnamecmp || (server_filter_list.head
- && check_filter(&server_filter_list, fname, 0) < 0))
+ && check_filter(&server_filter_list, fname, 0) < 0)) {
+ fnamecmp_type = FNAMECMP_FNAME;
+ }
} else {
/* Reminder: --inplace && --partial-dir are never
* enabled at the same time. */
if (inplace && make_backups > 0) {
if (!(fnamecmp = get_backup_name(fname)))
fnamecmp = fname;
} else {
/* Reminder: --inplace && --partial-dir are never
* enabled at the same time. */
if (inplace && make_backups > 0) {
if (!(fnamecmp = get_backup_name(fname)))
fnamecmp = fname;
+ else
+ fnamecmp_type = FNAMECMP_BACKUP;
} else if (partial_dir && partialptr)
fnamecmp = partialptr;
else
} else if (partial_dir && partialptr)
fnamecmp = partialptr;
else
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) {
st.st_mode = 0;
if (fd1 == -1) {
st.st_mode = 0;