summaryrefslogtreecommitdiffstats
path: root/cmd/zpool
diff options
context:
space:
mode:
authorTomohiro Kusumi <[email protected]>2018-03-10 06:47:32 +0900
committerBrian Behlendorf <[email protected]>2018-03-09 13:47:32 -0800
commit6b8655ad3fe070089b690b95d8485e41b3e7e67e (patch)
treeca4fd02a8cf16797f47cbe61e23e8acf6385f960 /cmd/zpool
parentcf63739191b6cac629d053930a4aea592bca3819 (diff)
Change functions which return literals to return `const char*`
get_format_prompt_string() and zpool_state_to_name() return a string literal which is read-only, thus they should return `const char*`. zpool_get_prop_string() returns a non-const string after successful nv-lookup, and returns a string literal otherwise. Since this function is designed to be used for read-only purpose, the return type should also be `const char*`. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Tomohiro Kusumi <[email protected]> Closes #7285
Diffstat (limited to 'cmd/zpool')
-rw-r--r--cmd/zpool/zpool_main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c
index ae35cbf4b..1d31fde46 100644
--- a/cmd/zpool/zpool_main.c
+++ b/cmd/zpool/zpool_main.c
@@ -1654,7 +1654,7 @@ print_status_config(zpool_handle_t *zhp, status_cbdata_t *cb, const char *name,
char *vname;
uint64_t notpresent;
spare_cbdata_t spare_cb;
- char *state;
+ const char *state;
char *path = NULL;
if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN,