/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2015 Joyent, Inc.
*/
/*
#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;
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;
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) {
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);