}
#if 0
- /* FIXME: remove or use */
+ /* FIXME: use or remove */
+
/* If we're making a backup, we'll detect the problem case in
copy_reg because SRC_PATH will no longer exist. Allowing
the test to be deferred lets cp do some useful things.
|| S_ISLNK (dst_sb_link->st_mode))
return 1;
- /* FIXME: explain */
if (x->dereference != DEREF_NEVER)
return 1;
#endif
}
}
+ /* It's ok to remove a destination symlink. But that works only when we
+ unlink before opening the destination and when they're on the same
+ partition. */
+ if (x->unlink_dest_before_opening
+ && S_ISLNK (dst_sb_link->st_mode))
+ return src_sb_link->st_dev == src_sb_link->st_dev;
+
if (x->xstat == lstat)
{
static struct stat tmp_dst_sb;
dst_sb_no_link = dst_sb;
}
- /* FIXME: hoist this to precede if/else? */
- /* It's ok to remove a destination symlink. But that works only when we
- unlink before opening the destination and when they're on the same
- partition. */
- if (x->unlink_dest_before_opening
- && S_ISLNK (dst_sb_link->st_mode))
- return src_sb_link->st_dev == src_sb_link->st_dev;
-
return 0;
}