aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libzfs
diff options
context:
space:
mode:
authorнаб <[email protected]>2020-11-13 23:38:29 +0100
committerBrian Behlendorf <[email protected]>2020-11-16 09:26:20 -0800
commite6c59cd171bf141eae232db2f4c33ff79d5862c3 (patch)
treec6651f4ca4b134376d3c75ef947014dff2910982 /lib/libzfs
parentfd654e412e48751e402a993594a39d336868e4c4 (diff)
zpool: correctly align columns with -p
zpool_expand_proplist() now ignores pl_fixed if its new literal argument is true. The rest is a consequence of needing to pass that down. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiao?=~Dska <[email protected]> Closes #11202
Diffstat (limited to 'lib/libzfs')
-rw-r--r--lib/libzfs/libzfs_pool.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libzfs/libzfs_pool.c b/lib/libzfs/libzfs_pool.c
index 16f8e3e7f..c1dc0d75b 100644
--- a/lib/libzfs/libzfs_pool.c
+++ b/lib/libzfs/libzfs_pool.c
@@ -784,7 +784,8 @@ zpool_set_prop(zpool_handle_t *zhp, const char *propname, const char *propval)
}
int
-zpool_expand_proplist(zpool_handle_t *zhp, zprop_list_t **plp)
+zpool_expand_proplist(zpool_handle_t *zhp, zprop_list_t **plp,
+ boolean_t literal)
{
libzfs_handle_t *hdl = zhp->zpool_hdl;
zprop_list_t *entry;
@@ -863,13 +864,12 @@ zpool_expand_proplist(zpool_handle_t *zhp, zprop_list_t **plp)
}
for (entry = *plp; entry != NULL; entry = entry->pl_next) {
-
- if (entry->pl_fixed)
+ if (entry->pl_fixed && !literal)
continue;
if (entry->pl_prop != ZPROP_INVAL &&
zpool_get_prop(zhp, entry->pl_prop, buf, sizeof (buf),
- NULL, B_FALSE) == 0) {
+ NULL, literal) == 0) {
if (strlen(buf) > entry->pl_width)
entry->pl_width = strlen(buf);
}