Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Prefer that kern.hostid is printed in hex, not as a...



details:   https://anonhg.NetBSD.org/src/rev/f00f5caa747c
branches:  trunk
changeset: 565643:f00f5caa747c
user:      atatat <atatat%NetBSD.org@localhost>
date:      Fri Apr 16 13:25:40 2004 +0000

description:
Prefer that kern.hostid is printed in hex, not as a signed decimal,
and avoid accidental sign-extension when setting it.

diffstat:

 sys/kern/init_sysctl.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 3482b88f98f5 -r f00f5caa747c sys/kern/init_sysctl.c
--- a/sys/kern/init_sysctl.c    Fri Apr 16 12:58:06 2004 +0000
+++ b/sys/kern/init_sysctl.c    Fri Apr 16 13:25:40 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: init_sysctl.c,v 1.26 2004/04/08 06:20:29 atatat Exp $ */
+/*     $NetBSD: init_sysctl.c,v 1.27 2004/04/16 13:25:40 atatat Exp $ */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: init_sysctl.c,v 1.26 2004/04/08 06:20:29 atatat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_sysctl.c,v 1.27 2004/04/16 13:25:40 atatat Exp $");
 
 #include "opt_sysv.h"
 #include "opt_multiprocessor.h"
@@ -313,7 +313,7 @@
                       sysctl_setlen, 0, &hostname, MAXHOSTNAMELEN,
                       CTL_KERN, KERN_HOSTNAME, CTL_EOL);
        sysctl_createv(clog, 0, NULL, NULL,
-                      CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
+                      CTLFLAG_PERMANENT|CTLFLAG_READWRITE|CTLFLAG_HEX,
                       CTLTYPE_INT, "hostid",
                       SYSCTL_DESCR("System host ID number"),
                       sysctl_kern_hostid, 0, NULL, 0,
@@ -1087,7 +1087,7 @@
        if (error || newp == NULL)
                return (error);
 
-       hostid = inthostid;
+       hostid = (unsigned)inthostid;
 
        return (0);
 }



Home | Main Index | Thread Index | Old Index