Author: ngie
Date: Wed Mar 29 08:00:11 2017
New Revision: 316127
URL: https://svnweb.freebsd.org/changeset/base/316127

Log:
  MFC r315699:
  
  Print out name of non-dynamic sysctl in sysctl_remove_oid_locked
  
  This will provide a slightly better smoking gun than just stating
  "can't remove non-dynamic nodes!" when calling sysctl_ctx_free(9)
  and sysctl_remove_{name,oid}(9) with a non-dynamic (likely
  static) sysctl.

Modified:
  stable/10/sys/kern/kern_sysctl.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/kern_sysctl.c
==============================================================================
--- stable/10/sys/kern/kern_sysctl.c    Wed Mar 29 07:30:59 2017        
(r316126)
+++ stable/10/sys/kern/kern_sysctl.c    Wed Mar 29 08:00:11 2017        
(r316127)
@@ -429,7 +429,8 @@ sysctl_remove_oid_locked(struct sysctl_o
        if (oidp == NULL)
                return(EINVAL);
        if ((oidp->oid_kind & CTLFLAG_DYN) == 0) {
-               printf("can't remove non-dynamic nodes!\n");
+               printf("Warning: can't remove non-dynamic nodes (%s)!\n",
+                   oidp->oid_name);
                return (EINVAL);
        }
        /*
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "[email protected]"

Reply via email to