diff options
author | Michael Kjorling <[email protected]> | 2013-11-01 20:26:11 +0100 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2013-12-18 16:46:35 -0800 |
commit | d1d7e2689db9e03f11c069ebc9f1ba12829e5dac (patch) | |
tree | 75b9a2b23334d5f673fb31f142f74146d351865c /cmd/mount_zfs | |
parent | 8ffef572ed2ba97e0c2d6a8aa2240012e611dc6f (diff) |
cstyle: Resolve C style issues
The vast majority of these changes are in Linux specific code.
They are the result of not having an automated style checker to
validate the code when it was originally written. Others were
caused when the common code was slightly adjusted for Linux.
This patch contains no functional changes. It only refreshes
the code to conform to style guide.
Everyone submitting patches for inclusion upstream should now
run 'make checkstyle' and resolve any warning prior to opening
a pull request. The automated builders have been updated to
fail a build if when 'make checkstyle' detects an issue.
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #1821
Diffstat (limited to 'cmd/mount_zfs')
-rw-r--r-- | cmd/mount_zfs/mount_zfs.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/cmd/mount_zfs/mount_zfs.c b/cmd/mount_zfs/mount_zfs.c index f7e2d99a0..82fa67c93 100644 --- a/cmd/mount_zfs/mount_zfs.c +++ b/cmd/mount_zfs/mount_zfs.c @@ -272,7 +272,7 @@ out: len = strlen(cwd); /* Do not add one when cwd already ends in a trailing '/' */ - if (!strncmp(cwd, dataset, len)) + if (strncmp(cwd, dataset, len) == 0) return (dataset + len + (cwd[len-1] != '/')); return (dataset); @@ -444,11 +444,11 @@ main(int argc, char **argv) * done until zfs is added to the default selinux policy configuration * as a known filesystem type which supports xattrs. */ - if (is_selinux_enabled() && !(zfsflags & ZS_NOCONTEXT)) { - (void) strlcat(mntopts, ",context=\"system_u:" - "object_r:file_t:s0\"", sizeof (mntopts)); - (void) strlcat(mtabopt, ",context=\"system_u:" - "object_r:file_t:s0\"", sizeof (mtabopt)); + if (is_selinux_enabled() && !(zfsflags & ZS_NOCONTEXT)) { + (void) strlcat(mntopts, ",context=\"system_u:" + "object_r:file_t:s0\"", sizeof (mntopts)); + (void) strlcat(mtabopt, ",context=\"system_u:" + "object_r:file_t:s0\"", sizeof (mtabopt)); } #endif /* HAVE_LIBSELINUX */ @@ -501,12 +501,12 @@ main(int argc, char **argv) * using zfs as your root file system both rc.sysinit/umountroot and * systemd depend on 'mount -o remount <mountpoint>' to work. */ - if (zfsutil && !strcmp(legacy, ZFS_MOUNTPOINT_LEGACY)) { + if (zfsutil && (strcmp(legacy, ZFS_MOUNTPOINT_LEGACY) == 0)) { (void) fprintf(stderr, gettext( "filesystem '%s' cannot be mounted using 'zfs mount'.\n" "Use 'zfs set mountpoint=%s' or 'mount -t zfs %s %s'.\n" "See zfs(8) for more information.\n"), - dataset, mntpoint, dataset, mntpoint); + dataset, mntpoint, dataset, mntpoint); return (MOUNT_USAGE); } |