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 -5
View File
@@ -68,7 +68,7 @@ zfs_allocatable_devs(nvlist_t *nv)
* Are there special vdevs?
*/
boolean_t
zfs_special_devs(nvlist_t *nv, char *type)
zfs_special_devs(nvlist_t *nv, const char *type)
{
char *bias;
uint_t c;
@@ -84,11 +84,9 @@ zfs_special_devs(nvlist_t *nv, char *type)
&bias) == 0) {
if (strcmp(bias, VDEV_ALLOC_BIAS_SPECIAL) == 0 ||
strcmp(bias, VDEV_ALLOC_BIAS_DEDUP) == 0) {
if (type != NULL && strcmp(bias, type) == 0) {
if (type == NULL ||
(type != NULL && strcmp(bias, type) == 0))
return (B_TRUE);
} else if (type == NULL) {
return (B_TRUE);
}
}
}
}