From owner-svn-src-stable@FreeBSD.ORG Wed Jul 23 00:41:12 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B8C5A2; Wed, 23 Jul 2014 00:41:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27E4829CA; Wed, 23 Jul 2014 00:41:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6N0fCpr003576; Wed, 23 Jul 2014 00:41:12 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6N0fCx4003575; Wed, 23 Jul 2014 00:41:12 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407230041.s6N0fCx4003575@svn.freebsd.org> From: Xin LI Date: Wed, 23 Jul 2014 00:41:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r269004 - stable/10/cddl/contrib/opensolaris/cmd/zpool X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jul 2014 00:41:12 -0000 Author: delphij Date: Wed Jul 23 00:41:11 2014 New Revision: 269004 URL: http://svnweb.freebsd.org/changeset/base/269004 Log: MFC r268470: MFV r268454: Refresh zpool list for each interval in order to produce fresh output. Illumos issue: 4966 zpool list iterator does not update output Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Wed Jul 23 00:38:23 2014 (r269003) +++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Wed Jul 23 00:41:11 2014 (r269004) @@ -3076,17 +3076,10 @@ zpool_do_list(int argc, char **argv) if (zprop_get_list(g_zfs, props, &cb.cb_proplist, ZFS_TYPE_POOL) != 0) usage(B_FALSE); - if ((list = pool_list_get(argc, argv, &cb.cb_proplist, &ret)) == NULL) - return (1); - - if (argc == 0 && !cb.cb_scripted && pool_list_count(list) == 0) { - (void) printf(gettext("no pools available\n")); - zprop_free_list(cb.cb_proplist); - return (0); - } - for (;;) { - pool_list_update(list); + if ((list = pool_list_get(argc, argv, &cb.cb_proplist, + &ret)) == NULL) + return (1); if (pool_list_count(list) == 0) break; @@ -3109,9 +3102,16 @@ zpool_do_list(int argc, char **argv) if (count != 0 && --count == 0) break; + pool_list_free(list); (void) sleep(interval); } + if (argc == 0 && !cb.cb_scripted && pool_list_count(list) == 0) { + (void) printf(gettext("no pools available\n")); + ret = 0; + } + + pool_list_free(list); zprop_free_list(cb.cb_proplist); return (ret); }