Enable -Wwrite-strings

Also, fix leak from ztest_global_vars_to_zdb_args()

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13348
This commit is contained in:
наб
2022-04-19 20:38:30 +02:00
committed by Brian Behlendorf
parent e7d90362e5
commit a926aab902
99 changed files with 633 additions and 717 deletions
+3 -1
View File
@@ -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);
+1 -1
View File
@@ -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,