]> git.proxmox.com Git - mirror_zfs.git/commit - cmd/zpool/zpool_main.c
Change functions which return literals to return `const char*`
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Fri, 9 Mar 2018 21:47:32 +0000 (06:47 +0900)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 9 Mar 2018 21:47:32 +0000 (13:47 -0800)
commit6b8655ad3fe070089b690b95d8485e41b3e7e67e
treeca4fd02a8cf16797f47cbe61e23e8acf6385f960
parentcf63739191b6cac629d053930a4aea592bca3819
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
cmd/zpool/zpool_main.c
include/libzfs.h
lib/libzfs/libzfs_crypto.c
lib/libzfs/libzfs_pool.c