diff options
author | Richard Yao <[email protected]> | 2023-03-11 13:39:24 -0500 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2023-03-14 15:25:50 -0700 |
commit | d1807f168edd09ca26a5a0c6b570686b982808ad (patch) | |
tree | db5bfd360991fa3528fe688247eb289ef1d8b859 /lib/libzfs/libzfs_util.c | |
parent | 50f6934b9c1f4aa583592e8a969b934440a44c64 (diff) |
nvpair: Constify string functions
After addressing coverity complaints involving `nvpair_name()`, the
compiler started complaining about dropping const. This lead to a rabbit
hole where not only `nvpair_name()` needed to be constified, but also
`nvpair_value_string()`, `fnvpair_value_string()` and a few other static
functions, plus variable pointers throughout the code. The result became
a fairly big change, so it has been split out into its own patch.
Reviewed-by: Tino Reichardt <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Richard Yao <[email protected]>
Closes #14612
Diffstat (limited to 'lib/libzfs/libzfs_util.c')
-rw-r--r-- | lib/libzfs/libzfs_util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libzfs/libzfs_util.c b/lib/libzfs/libzfs_util.c index 2507bfecd..b0d7b2afa 100644 --- a/lib/libzfs/libzfs_util.c +++ b/lib/libzfs/libzfs_util.c @@ -1595,13 +1595,13 @@ zfs_nicestrtonum(libzfs_handle_t *hdl, const char *value, uint64_t *num) */ int zprop_parse_value(libzfs_handle_t *hdl, nvpair_t *elem, int prop, - zfs_type_t type, nvlist_t *ret, char **svalp, uint64_t *ivalp, + zfs_type_t type, nvlist_t *ret, const char **svalp, uint64_t *ivalp, const char *errbuf) { data_type_t datatype = nvpair_type(elem); zprop_type_t proptype; const char *propname; - char *value; + const char *value; boolean_t isnone = B_FALSE; boolean_t isauto = B_FALSE; int err = 0; |