From owner-svn-src-all@FreeBSD.ORG Tue Aug 31 19:01:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FA1F10656A4; Tue, 31 Aug 2010 19:01:46 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4EF358FC1E; Tue, 31 Aug 2010 19:01:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7VJ1kR7039027; Tue, 31 Aug 2010 19:01:46 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7VJ1kGQ039025; Tue, 31 Aug 2010 19:01:46 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201008311901.o7VJ1kGQ039025@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 31 Aug 2010 19:01:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212067 - head/cddl/contrib/opensolaris/cmd/zpool X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Aug 2010 19:01:46 -0000 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); }