Fix some style nits.
Fix(?) some compile warnings regarding const handling.
This commit is contained in:
parent
c828c7b784
commit
93e8459a02
@ -301,7 +301,8 @@ sysctl_remove_oid(struct sysctl_oid *oidp, int del, int recurse)
|
||||
}
|
||||
sysctl_unregister_oid(oidp);
|
||||
if (del) {
|
||||
free ((char *)oidp->oid_name, M_SYSCTLOID);
|
||||
free((void *)(uintptr_t)(const void *)oidp->oid_name,
|
||||
M_SYSCTLOID);
|
||||
free(oidp, M_SYSCTLOID);
|
||||
}
|
||||
}
|
||||
@ -319,6 +320,7 @@ sysctl_add_oid(struct sysctl_ctx_list *clist, struct sysctl_oid_list *parent,
|
||||
{
|
||||
struct sysctl_oid *oidp;
|
||||
ssize_t len;
|
||||
char *newname;
|
||||
|
||||
/* You have to hook up somewhere.. */
|
||||
if (parent == NULL)
|
||||
@ -344,9 +346,10 @@ sysctl_add_oid(struct sysctl_ctx_list *clist, struct sysctl_oid_list *parent,
|
||||
oidp->oid_number = number;
|
||||
oidp->oid_refcnt = 1;
|
||||
len = strlen(name);
|
||||
oidp->oid_name = (const char *)malloc(len + 1, M_SYSCTLOID, M_WAITOK);
|
||||
bcopy(name, (char *)oidp->oid_name, len + 1);
|
||||
(char)oidp->oid_name[len] = '\0';
|
||||
newname = malloc(len + 1, M_SYSCTLOID, M_WAITOK);
|
||||
bcopy(name, newname, len + 1);
|
||||
newname[len] = '\0';
|
||||
oidp->oid_name = newname;
|
||||
oidp->oid_handler = handler;
|
||||
oidp->oid_kind = CTLFLAG_DYN | kind;
|
||||
if ((kind & CTLTYPE) == CTLTYPE_NODE) {
|
||||
|
Loading…
Reference in New Issue
Block a user