summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorGeorge Wilson <[email protected]>2015-07-05 21:00:34 +0200
committerBrian Behlendorf <[email protected]>2015-07-10 12:00:35 -0700
commit3e43edd2c5b40d49bae9881566570a5fb7c2c181 (patch)
tree8e8ff3a63bdf695528cbdddb0f66bd408c34ec1f /cmd
parent411bf201f5703aa34392f4872ea01bf54c7d3076 (diff)
Illumos 4966 - zpool list iterator does not update output
4966 zpool list iterator does not update output Reviewed by: Matthew Ahrens <[email protected]> Reviewed by: Christopher Siden <[email protected]> Reviewed by: Dan McDonald <[email protected]> Approved by: Garrett D'Amore <[email protected]> References: https://github.com/illumos/illumos-gate/commit/cd67d23 https://www.illumos.org/issues/4966 Ported-by: kernelOfTruth [email protected] Signed-off-by: Brian Behlendorf <[email protected]> Closes #3566
Diffstat (limited to 'cmd')
-rw-r--r--cmd/zpool/zpool_main.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c
index fd1e8284a..e6517574d 100644
--- a/cmd/zpool/zpool_main.c
+++ b/cmd/zpool/zpool_main.c
@@ -3285,17 +3285,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;
@@ -3315,9 +3308,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);
}