continue;
}
- strlcpy(p, F_BASENAME(fp), remainder);
+ strlcpy(p, fp->basename, remainder);
/* Save stack by recursing to ourself directly. */
if (S_ISDIR(fp->mode)
&& delete_dir_contents(fname, flags | DEL_RECURSE) != DR_SUCCESS)
int unchanged_attrs(struct file_struct *file, STRUCT_STAT *st)
{
- if (preserve_perms
- && (unsigned)(st->st_mode & CHMOD_BITS) != (file->mode & CHMOD_BITS))
+ if (preserve_perms && !BITS_EQUAL(st->st_mode, file->mode, CHMOD_BITS))
return 0;
if (am_root && preserve_uid && st->st_uid != F_UID(file))
&& (!(iflags & ITEM_XNAME_FOLLOWS) || *xname))
|| (keep_time && cmp_time(file->modtime, st->st_mtime) != 0))
iflags |= ITEM_REPORT_TIME;
- if ((unsigned)(st->st_mode & CHMOD_BITS) != (file->mode & CHMOD_BITS))
+ if (!BITS_EQUAL(st->st_mode, file->mode, CHMOD_BITS))
iflags |= ITEM_REPORT_PERMS;
if (preserve_uid && am_root && F_UID(file) != st->st_uid)
iflags |= ITEM_REPORT_OWNER;
static int find_fuzzy(struct file_struct *file, struct file_list *dirlist)
{
int fname_len, fname_suf_len;
- const char *fname_suf, *fname = F_BASENAME(file);
+ const char *fname_suf, *fname = file->basename;
uint32 lowest_dist = 25 << 16; /* ignore a distance greater than 25 */
int j, lowest_j = -1;
if (!S_ISREG(fp->mode) || !F_LENGTH(fp) || fp->flags & FLAG_SENT)
continue;
- name = F_BASENAME(fp);
+ name = fp->basename;
if (F_LENGTH(fp) == F_LENGTH(file)
&& cmp_time(fp->modtime, file->modtime) == 0) {
}
#ifdef SUPPORT_HARD_LINKS
- if (preserve_hard_links && F_NOT_HLINK_FIRST(file)
+ if (preserve_hard_links && F_HLINK_NOT_FIRST(file)
&& hard_link_check(file, ndx, fname, statret, &st, itemizing, code))
return;
#endif
statret = 1;
}
#ifdef SUPPORT_HARD_LINKS
- if (preserve_hard_links && F_NOT_HLINK_LAST(file))
+ if (preserve_hard_links && F_HLINK_NOT_LAST(file))
return;
#endif
if (do_symlink(sl, fname) != 0) {
t = "special file";
}
if (statret == 0
- && (unsigned)(st.st_mode & ~CHMOD_BITS) == (file->mode & ~CHMOD_BITS)
+ && BITS_EQUAL(st.st_mode, file->mode, _S_IFMT)
&& st.st_rdev == rdev) {
/* The device or special file is identical. */
if (itemizing)
statret = 1;
}
#ifdef SUPPORT_HARD_LINKS
- if (preserve_hard_links && F_NOT_HLINK_LAST(file))
+ if (preserve_hard_links && F_HLINK_NOT_LAST(file))
return;
#endif
if (verbose > 2) {
if (statret != 0) {
#ifdef SUPPORT_HARD_LINKS
- if (preserve_hard_links && F_NOT_HLINK_LAST(file))
+ if (preserve_hard_links && F_HLINK_NOT_LAST(file))
return;
#endif
if (stat_errno == ENOENT)
do_unlink(partialptr);
handle_partial_dir(partialptr, PDIR_DELETE);
}
- if (itemizing) {
- itemize(file, ndx, statret, &st,
- 0, 0, NULL);
- }
+ if (itemizing)
+ itemize(file, ndx, statret, &st, 0, 0, NULL);
set_file_attrs(fname, file, &st, maybe_ATTRS_REPORT);
#ifdef SUPPORT_HARD_LINKS
if (preserve_hard_links && F_IS_HLINKED(file))
pretend_missing:
/* pretend the file didn't exist */
#ifdef SUPPORT_HARD_LINKS
- if (preserve_hard_links && F_NOT_HLINK_LAST(file))
+ if (preserve_hard_links && F_HLINK_NOT_LAST(file))
return;
#endif
statret = real_ret = -1;
if (fnamecmp_type == FNAMECMP_FUZZY)
iflags |= ITEM_XNAME_FOLLOWS;
itemize(file, -1, real_ret, &real_st, iflags, fnamecmp_type,
- fuzzy_file ? F_BASENAME(fuzzy_file) : NULL);
+ fuzzy_file ? fuzzy_file->basename : NULL);
}
if (!do_xfers) {