Add a helpful message that can help point to why a sysctl tree removal failed

Obtained from:	Netflix
MFC after:	3 days
This commit is contained in:
Scott Long 2013-08-09 01:04:44 +00:00
parent 43667c1f68
commit f510415d84

View File

@ -412,8 +412,12 @@ sysctl_remove_oid_locked(struct sysctl_oid *oidp, int del, int recurse)
if (oidp->oid_refcnt == 1) {
SLIST_FOREACH_SAFE(p,
SYSCTL_CHILDREN(oidp), oid_link, tmp) {
if (!recurse)
if (!recurse) {
printf("Warning: failed attempt to "
"remove oid %s with child %s\n",
oidp->oid_name, p->oid_name);
return (ENOTEMPTY);
}
error = sysctl_remove_oid_locked(p, del,
recurse);
if (error)