Date: Tue, 31 Aug 2010 19:01:46 +0000 (UTC) From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r212067 - head/cddl/contrib/opensolaris/cmd/zpool Message-ID: <201008311901.o7VJ1kGQ039025@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pjd Date: Tue Aug 31 19:01:46 2010 New Revision: 212067 URL: http://svn.freebsd.org/changeset/base/212067 Log: 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 Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Tue Aug 31 19:01:12 2010 (r212066) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Tue Aug 31 19:01:46 2010 (r212067) @@ -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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201008311901.o7VJ1kGQ039025>