aboutsummaryrefslogtreecommitdiff
path: root/sbin/mksnap_ffs/mksnap_ffs.c
diff options
context:
space:
mode:
authorRyan Moeller <freqlabs@FreeBSD.org>2020-05-21 01:55:35 +0000
committerRyan Moeller <freqlabs@FreeBSD.org>2020-05-21 01:55:35 +0000
commit245bfd34da590e12884bd1a5677f3227a36d4bcf (patch)
treebd3f30b09ed71ce881641d920535207ad89d75dc /sbin/mksnap_ffs/mksnap_ffs.c
parent49caa483b3fafffd9cf5197eb30e8bb235aa7410 (diff)
downloadsrc-245bfd34da590e12884bd1a5677f3227a36d4bcf.tar.gz
src-245bfd34da590e12884bd1a5677f3227a36d4bcf.zip
Deduplicate fsid comparisons
Comparing fsid_t objects requires internal knowledge of the fsid structure and yet this is duplicated across a number of places in the code. Simplify by creating a fsidcmp function (macro). Reviewed by: mjg, rmacklem Approved by: mav (mentor) MFC after: 1 week Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D24749
Notes
Notes: svn path=/head/; revision=361313
Diffstat (limited to 'sbin/mksnap_ffs/mksnap_ffs.c')
-rw-r--r--sbin/mksnap_ffs/mksnap_ffs.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sbin/mksnap_ffs/mksnap_ffs.c b/sbin/mksnap_ffs/mksnap_ffs.c
index 374617bf50fd..5d230701de85 100644
--- a/sbin/mksnap_ffs/mksnap_ffs.c
+++ b/sbin/mksnap_ffs/mksnap_ffs.c
@@ -81,8 +81,7 @@ issamefs(const char *path, struct statfs *stfsp)
return (-1);
if (statfs(path, &stfsbuf) < 0)
return (-1);
- if ((stfsbuf.f_fsid.val[0] != stfsp->f_fsid.val[0]) ||
- (stfsbuf.f_fsid.val[1] != stfsp->f_fsid.val[1]))
+ if (fsidcmp(&stfsbuf.f_fsid, &stfsp->f_fsid) != 0)
return (0);
return (1);
}