mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-24 11:18:52 +03:00
Fix strdup conflict on other platforms
In the FreeBSD kernel the strdup signature is: ``` char *strdup(const char *__restrict, struct malloc_type *); ``` It's unfortunate that the developers have chosen to change the signature of libc functions - but it's what I have to deal with. Reviewed-by: Jorgen Lundman <lundman@lundman.net> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Matt Macy <mmacy@FreeBSD.org> Closes #9433
This commit is contained in:
committed by
Brian Behlendorf
parent
c5858ff946
commit
e4f5fa1229
@@ -631,7 +631,7 @@ kstat_detect_collision(kstat_proc_entry_t *kpep)
|
||||
parent = kmem_asprintf("%s", kpep->kpe_module);
|
||||
|
||||
if ((cp = strrchr(parent, '/')) == NULL) {
|
||||
strfree(parent);
|
||||
kmem_strfree(parent);
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -639,13 +639,13 @@ kstat_detect_collision(kstat_proc_entry_t *kpep)
|
||||
if ((module = kstat_find_module(parent)) != NULL) {
|
||||
list_for_each_entry(tmp, &module->ksm_kstat_list, kpe_list) {
|
||||
if (strncmp(tmp->kpe_name, cp+1, KSTAT_STRLEN) == 0) {
|
||||
strfree(parent);
|
||||
kmem_strfree(parent);
|
||||
return (EEXIST);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
strfree(parent);
|
||||
kmem_strfree(parent);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user