extern int protocol_version;
extern int fuzzy_basis;
extern int always_checksum;
+extern int checksum_len;
extern char *partial_dir;
extern char *basis_dir[];
extern int compare_dest;
static int deletion_count = 0; /* used to implement --max-delete */
+/* For calling delete_file() */
+#define DEL_FORCE_RECURSE (1<<1) /* recurse even w/o --force */
+#define DEL_TERSE (1<<3)
+
static int is_backup_file(char *fn)
{
/* Delete a file or directory. If DEL_FORCE_RECURSE is set in the flags, or if
- * force_delete is set, this will delete recursively as long as DEL_NO_RECURSE
- * is not set in the flags.
+ * force_delete is set, this will delete recursively.
*
* Note that fname must point to a MAXPATHLEN buffer if the mode indicates it's
* a directory! (The buffer is used for recursion, but returned unchanged.)
return -1;
}
- zap_dir = (flags & DEL_FORCE_RECURSE || (force_delete && recurse))
- && !(flags & DEL_NO_RECURSE);
+ zap_dir = flags & DEL_FORCE_RECURSE || (force_delete && recurse);
if ((max_delete && ++deletion_count > max_delete)
|| (dry_run && zap_dir)) {
ok = 0;
if (always_checksum && S_ISREG(st->st_mode)) {
char sum[MD4_SUM_LENGTH];
file_checksum(fn, sum, st->st_size);
- return memcmp(sum, file->u.sum, protocol_version < 21 ? 2
- : MD4_SUM_LENGTH) == 0;
+ return memcmp(sum, file->u.sum, checksum_len) == 0;
}
if (size_only)
S_ISDIR(file->mode)) < 0) {
if (S_ISDIR(file->mode))
excluded_below = file->dir.depth;
- skipping:
+ skipping:
if (verbose) {
rprintf(FINFO,
"skipping server-excluded file \"%s\"\n",
return;
}
-prepare_to_open:
+ prepare_to_open:
if (partialptr) {
st = partial_st;
fnamecmp = partialptr;
if (fd == -1) {
rsyserr(FERROR, errno, "failed to open %s, continuing",
full_fname(fnamecmp));
- pretend_missing:
+ pretend_missing:
/* pretend the file didn't exist */
if (preserve_hard_links && file->link_u.links
&& hard_link_check(file, ndx, fname, statret, &st,
if (verbose > 2)
rprintf(FINFO, "generating and sending sums for %d\n", ndx);
-notify_others:
+ notify_others:
write_int(f_out, ndx);
if (itemizing) {
int iflags = ITEM_TRANSFER;