summaryrefslogtreecommitdiffstats
path: root/cddl/contrib/opensolaris/lib
diff options
context:
space:
mode:
authoravg <avg@FreeBSD.org>2017-10-30 10:29:26 +0000
committeravg <avg@FreeBSD.org>2017-10-30 10:29:26 +0000
commit864fc631ee977311e02cd82e219b85ac785e41b2 (patch)
tree9e207184e3621ae62f498a76035c366d2ee1110b /cddl/contrib/opensolaris/lib
parent5d159c98399526c30894b8d90542b27c3d40b797 (diff)
downloadFreeBSD-src-864fc631ee977311e02cd82e219b85ac785e41b2.zip
FreeBSD-src-864fc631ee977311e02cd82e219b85ac785e41b2.tar.gz
MFC r324346: MFV r316931: 6268 zfs diff confused by moving a file to another directory
Diffstat (limited to 'cddl/contrib/opensolaris/lib')
-rw-r--r--cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c
index 1447b4c..840c814 100644
--- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c
+++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c
@@ -55,15 +55,6 @@
#define ZDIFF_REMOVED '-'
#define ZDIFF_RENAMED 'R'
-static boolean_t
-do_name_cmp(const char *fpath, const char *tpath)
-{
- char *fname, *tname;
- fname = strrchr(fpath, '/') + 1;
- tname = strrchr(tpath, '/') + 1;
- return (strcmp(fname, tname) == 0);
-}
-
typedef struct differ_info {
zfs_handle_t *zhp;
char *fromsnap;
@@ -262,7 +253,6 @@ static int
write_inuse_diffs_one(FILE *fp, differ_info_t *di, uint64_t dobj)
{
struct zfs_stat fsb, tsb;
- boolean_t same_name;
mode_t fmode, tmode;
char fobjname[MAXPATHLEN], tobjname[MAXPATHLEN];
int fobjerr, tobjerr;
@@ -323,7 +313,6 @@ write_inuse_diffs_one(FILE *fp, differ_info_t *di, uint64_t dobj)
if (fmode != tmode && fsb.zs_gen == tsb.zs_gen)
tsb.zs_gen++; /* Force a generational difference */
- same_name = do_name_cmp(fobjname, tobjname);
/* Simple modification or no change */
if (fsb.zs_gen == tsb.zs_gen) {
@@ -334,7 +323,7 @@ write_inuse_diffs_one(FILE *fp, differ_info_t *di, uint64_t dobj)
if (change) {
print_link_change(fp, di, change,
change > 0 ? fobjname : tobjname, &tsb);
- } else if (same_name) {
+ } else if (strcmp(fobjname, tobjname) == 0) {
print_file(fp, di, ZDIFF_MODIFIED, fobjname, &tsb);
} else {
print_rename(fp, di, fobjname, tobjname, &tsb);
OpenPOWER on IntegriCloud