diff options
author | наб <[email protected]> | 2022-04-19 20:38:30 +0200 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2022-06-29 14:08:54 -0700 |
commit | a926aab902ac5c680f4766568d19674b80fb58bb (patch) | |
tree | 2f505528a4dea156b50c5602dbcefe48b9e902d7 /lib/libzutil | |
parent | e7d90362e5d5f873e1272519da96780cf00a0e28 (diff) |
Enable -Wwrite-strings
Also, fix leak from ztest_global_vars_to_zdb_args()
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Closes #13348
Diffstat (limited to 'lib/libzutil')
-rw-r--r-- | lib/libzutil/os/linux/zutil_import_os.c | 4 | ||||
-rw-r--r-- | lib/libzutil/zutil_import.c | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/libzutil/os/linux/zutil_import_os.c b/lib/libzutil/os/linux/zutil_import_os.c index 6b825fcd7..85f367237 100644 --- a/lib/libzutil/os/linux/zutil_import_os.c +++ b/lib/libzutil/os/linux/zutil_import_os.c @@ -328,7 +328,9 @@ zpool_find_import_blkid(libpc_handle_t *hdl, pthread_mutex_t *lock, return (EINVAL); } - error = blkid_dev_set_search(iter, "TYPE", "zfs_member"); + /* Only const char *s since 2.32 */ + error = blkid_dev_set_search(iter, + (char *)"TYPE", (char *)"zfs_member"); if (error != 0) { blkid_dev_iterate_end(iter); blkid_put_cache(cache); diff --git a/lib/libzutil/zutil_import.c b/lib/libzutil/zutil_import.c index 3744a1c34..26fba2cad 100644 --- a/lib/libzutil/zutil_import.c +++ b/lib/libzutil/zutil_import.c @@ -1543,7 +1543,7 @@ discover_cached_paths(libpc_handle_t *hdl, nvlist_t *nv, */ if (nvlist_lookup_string(nv, ZPOOL_CONFIG_PATH, &path) == 0) { if ((dl = zfs_dirnamelen(path)) == -1) - path = "."; + path = (char *)"."; else path[dl] = '\0'; return (zpool_find_import_scan_dir(hdl, lock, cache, |