summaryrefslogtreecommitdiffstats
path: root/include/libzfs.h
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 /include/libzfs.h
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 'include/libzfs.h')
-rw-r--r--include/libzfs.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/libzfs.h b/include/libzfs.h
index 71a588325..5288ff7f8 100644
--- a/include/libzfs.h
+++ b/include/libzfs.h
@@ -233,7 +233,7 @@ extern zpool_handle_t *zpool_open_canfail(libzfs_handle_t *, const char *);
extern void zpool_close(zpool_handle_t *);
extern const char *zpool_get_name(zpool_handle_t *);
extern int zpool_get_state(zpool_handle_t *);
-extern char *zpool_state_to_name(vdev_state_t, vdev_aux_t);
+extern const char *zpool_state_to_name(vdev_state_t, vdev_aux_t);
extern const char *zpool_pool_state_to_name(pool_state_t);
extern void zpool_free_handles(libzfs_handle_t *);