o General style improvemnts.

Submitted by:	bde
This commit is contained in:
Robert Watson 2001-11-08 15:31:19 +00:00
parent 44a280a67e
commit eacb362f8a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=86190

View File

@ -41,6 +41,7 @@
*/
#include "opt_global.h"
#include "opt_posix.h"
#include <sys/param.h>
#include <sys/kernel.h>
@ -75,6 +76,10 @@ SYSCTL_NODE(, CTL_P1003_1B, p1003_1b, CTLFLAG_RW, 0,
SYSCTL_NODE(, OID_AUTO, compat, CTLFLAG_RW, 0,
"Compatibility code");
#ifdef REGRESSION
SYSCTL_NODE(, OID_AUTO, regression, CTLFLAG_RW, 0,
"Regression test MIB");
#endif
SYSCTL_STRING(_kern, KERN_OSRELEASE, osrelease, CTLFLAG_RD,
osrelease, 0, "Operating system type");
@ -144,10 +149,6 @@ static char machine_arch[] = MACHINE_ARCH;
SYSCTL_STRING(_hw, HW_MACHINE_ARCH, machine_arch, CTLFLAG_RD,
machine_arch, 0, "System architecture");
#ifdef REGRESSION
SYSCTL_NODE(, OID_AUTO, regression, CTLFLAG_RW, 0, "Regression test MIB");
#endif /* !REGRESSION */
char hostname[MAXHOSTNAMELEN];
static int
@ -157,7 +158,7 @@ sysctl_hostname(SYSCTL_HANDLER_ARGS)
if (jailed(req->td->td_proc->p_ucred)) {
if (!jail_set_hostname_allowed && req->newptr)
return(EPERM);
return (EPERM);
error = sysctl_handle_string(oidp,
req->td->td_proc->p_ucred->cr_prison->pr_host,
sizeof req->td->td_proc->p_ucred->cr_prison->pr_host, req);
@ -172,11 +173,11 @@ SYSCTL_PROC(_kern, KERN_HOSTNAME, hostname,
0, 0, sysctl_hostname, "A", "Hostname");
#ifdef REGRESSION
int regression_securelevel_nonmonotonic=0;
static int regression_securelevel_nonmonotonic = 0;
SYSCTL_INT(_regression, OID_AUTO, securelevel_nonmonotonic, CTLFLAG_RW,
&regression_securelevel_nonmonotonic, 0, "securelevel may be lowered");
#endif /* !REGRESSION */
#endif
int securelevel = -1;
@ -206,14 +207,14 @@ sysctl_kern_securelvl(SYSCTL_HANDLER_ARGS)
if (pr != NULL) {
#ifdef REGRESSION
if (!regression_securelevel_nonmonotonic)
#endif /* !REGRESSION */
#endif
if (level < imax(securelevel, pr->pr_securelevel))
return (EPERM);
pr->pr_securelevel = level;
} else {
#ifdef REGRESSION
if (!regression_securelevel_nonmonotonic)
#endif /* !REGRESSION */
#endif
if (level < securelevel)
return (EPERM);
securelevel = level;
@ -229,7 +230,7 @@ char domainname[MAXHOSTNAMELEN];
SYSCTL_STRING(_kern, KERN_NISDOMAINNAME, domainname, CTLFLAG_RW,
&domainname, sizeof(domainname), "Name of the current YP/NIS domain");
unsigned long hostid;
u_long hostid;
SYSCTL_ULONG(_kern, KERN_HOSTID, hostid, CTLFLAG_RW, &hostid, 0, "Host ID");
/*