Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Jul 2014 21:07:20 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r268470 - head/cddl/contrib/opensolaris/cmd/zpool
Message-ID:  <201407092107.s69L7KIg023212@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: delphij
Date: Wed Jul  9 21:07:20 2014
New Revision: 268470
URL: http://svnweb.freebsd.org/changeset/base/268470

Log:
  MFV r268454:
  
  Refresh zpool list for each interval in order to produce fresh
  output.
  
  Illumos issue: 4966 zpool list iterator does not update output
  
  MFC after:	 2 weeks

Modified:
  head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)

Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c	Wed Jul  9 20:57:42 2014	(r268469)
+++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c	Wed Jul  9 21:07:20 2014	(r268470)
@@ -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);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407092107.s69L7KIg023212>