aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorнаб <[email protected]>2022-02-20 04:06:02 +0100
committerBrian Behlendorf <[email protected]>2022-03-04 12:08:34 -0800
commit06b805067833902613de1871fa01e29fc80c8247 (patch)
tree7347b313d8135380f9d07f3399bbb1cef91fc339
parentcdb3eb5aa4d396e94dd985244a62c80bac689cfe (diff)
zpool: main: list: don't pay for printf
Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #13125
-rw-r--r--cmd/zpool/zpool_main.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c
index 07fabde8a..717d8b806 100644
--- a/cmd/zpool/zpool_main.c
+++ b/cmd/zpool/zpool_main.c
@@ -5022,7 +5022,7 @@ get_namewidth(zpool_handle_t *zhp, int min_width, int flags, boolean_t verbose)
if ((config = zpool_get_config(zhp, NULL)) != NULL) {
verify(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE,
&nvroot) == 0);
- unsigned int poolname_len = strlen(zpool_get_name(zhp));
+ size_t poolname_len = strlen(zpool_get_name(zhp));
if (verbose == B_FALSE) {
width = MAX(poolname_len, min_width);
} else {
@@ -5961,7 +5961,7 @@ print_header(list_cbdata_t *cb)
}
if (!first)
- (void) printf(" ");
+ (void) fputs(" ", stdout);
else
first = B_FALSE;
@@ -5979,14 +5979,14 @@ print_header(list_cbdata_t *cb)
}
if (pl->pl_next == NULL && !right_justify)
- (void) printf("%s", header);
+ (void) fputs(header, stdout);
else if (right_justify)
(void) printf("%*s", (int)width, header);
else
(void) printf("%-*s", (int)width, header);
}
- (void) printf("\n");
+ (void) fputc('\n', stdout);
}
/*
@@ -6016,9 +6016,9 @@ print_pool(zpool_handle_t *zhp, list_cbdata_t *cb)
if (!first) {
if (cb->cb_scripted)
- (void) printf("\t");
+ (void) fputc('\t', stdout);
else
- (void) printf(" ");
+ (void) fputs(" ", stdout);
} else {
first = B_FALSE;
}
@@ -6048,14 +6048,14 @@ print_pool(zpool_handle_t *zhp, list_cbdata_t *cb)
* format specifier.
*/
if (cb->cb_scripted || (pl->pl_next == NULL && !right_justify))
- (void) printf("%s", propstr);
+ (void) fputs(propstr, stdout);
else if (right_justify)
(void) printf("%*s", (int)width, propstr);
else
(void) printf("%-*s", (int)width, propstr);
}
- (void) printf("\n");
+ (void) fputc('\n', stdout);
}
static void
@@ -6191,7 +6191,7 @@ print_list_stats(zpool_handle_t *zhp, const char *name, nvlist_t *nv,
}
print_one_column(ZPOOL_PROP_HEALTH, 0, state, scripted,
B_TRUE, format);
- (void) printf("\n");
+ (void) fputc('\n', stdout);
}
if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN,