summaryrefslogtreecommitdiffstats
path: root/cddl
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2010-08-31 19:01:46 +0000
committerpjd <pjd@FreeBSD.org>2010-08-31 19:01:46 +0000
commitfc642a405bf986ef9b4610674ae1179420e7dbda (patch)
tree4b004d806942637cf89f5207155bdb78d9dd4c4d /cddl
parent5ce1bc240602cb74e7088084bc24327adb24e847 (diff)
downloadFreeBSD-src-fc642a405bf986ef9b4610674ae1179420e7dbda.zip
FreeBSD-src-fc642a405bf986ef9b4610674ae1179420e7dbda.tar.gz
Eliminate confusing while () loop. In the first version of the code it was
there to avoid gotos, but in the current version it serves no purpose. MFC after: 2 weeks
Diffstat (limited to 'cddl')
-rw-r--r--cddl/contrib/opensolaris/cmd/zpool/zpool_main.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c b/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
index 2d98916..08d8afe 100644
--- a/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
+++ b/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
@@ -3347,20 +3347,19 @@ is_root_pool(zpool_handle_t *zhp)
static boolean_t stated = B_FALSE;
char *slash;
- while (!stated) {
+ if (!stated) {
stated = B_TRUE;
if (statfs("/", &sfs) == -1) {
(void) fprintf(stderr,
"Unable to stat root file system: %s.\n",
strerror(errno));
- break;
+ return (0);
}
if (strcmp(sfs.f_fstypename, "zfs") != 0)
- break;
+ return (0);
poolname = sfs.f_mntfromname;
if ((slash = strchr(poolname, '/')) != NULL)
*slash = '\0';
- break;
}
return (poolname != NULL && strcmp(poolname, zpool_get_name(zhp)) == 0);
}
OpenPOWER on IntegriCloud