mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
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:
committed by
Brian Behlendorf
parent
cf63739191
commit
6b8655ad3f
+1
-1
@@ -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 *);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user