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 <behlendorf1@llnl.gov>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@osnexus.com>
Closes #7285
This commit is contained in:
Tomohiro Kusumi
2018-03-10 06:47:32 +09:00
committed by Brian Behlendorf
parent cf63739191
commit 6b8655ad3f
4 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -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,