summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorscottl <scottl@FreeBSD.org>2013-08-09 01:04:44 +0000
committerscottl <scottl@FreeBSD.org>2013-08-09 01:04:44 +0000
commit40b11a17462845928214986df55e541227bdeda1 (patch)
treef2d382eee3ec5ab86e7904346b82cffb986c684e
parentccc3c4970e788379d0e1e21c2a8a5a56b6fb6d74 (diff)
downloadFreeBSD-src-40b11a17462845928214986df55e541227bdeda1.zip
FreeBSD-src-40b11a17462845928214986df55e541227bdeda1.tar.gz
Add a helpful message that can help point to why a sysctl tree removal failed
Obtained from: Netflix MFC after: 3 days
-rw-r--r--sys/kern/kern_sysctl.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index 68bf453..416f85f 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -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)
OpenPOWER on IntegriCloud