diff options
author | delphij <delphij@FreeBSD.org> | 2014-07-23 00:41:11 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2014-07-23 00:41:11 +0000 |
commit | 126b8ac4b468f2611990a576c0a18e712247b8bf (patch) | |
tree | f901c8259b64674e17089eddcd2df29eecb555a3 | |
parent | 3750365a9ccd13c9d62fe52ab0ab06b543a54e5a (diff) | |
download | FreeBSD-src-126b8ac4b468f2611990a576c0a18e712247b8bf.zip FreeBSD-src-126b8ac4b468f2611990a576c0a18e712247b8bf.tar.gz |
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
-rw-r--r-- | cddl/contrib/opensolaris/cmd/zpool/zpool_main.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c b/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c index bec5e70..7f27bb0 100644 --- a/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c +++ b/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c @@ -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); } |