Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Adjust error returns in kern.cp_time when a specifi...



details:   https://anonhg.NetBSD.org/src/rev/bac0f5fa055e
branches:  trunk
changeset: 556839:bac0f5fa055e
user:      atatat <atatat%NetBSD.org@localhost>
date:      Sun Dec 28 22:24:12 2003 +0000

description:
Adjust error returns in kern.cp_time when a specific processor is
being requested so that (1) the uniprocessor case and the
multiprocessor case are more similar and (2) so that we return ENOENT
when a non-existent processor is requested (which is both more
sensible and follows the general order of things anyway).

diffstat:

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

diffs (38 lines):

diff -r 94cece173750 -r bac0f5fa055e sys/kern/init_sysctl.c
--- a/sys/kern/init_sysctl.c    Sun Dec 28 22:19:59 2003 +0000
+++ b/sys/kern/init_sysctl.c    Sun Dec 28 22:24:12 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: init_sysctl.c,v 1.17 2003/12/28 22:19:59 atatat Exp $ */
+/*     $NetBSD: init_sysctl.c,v 1.18 2003/12/28 22:24:12 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.17 2003/12/28 22:19:59 atatat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_sysctl.c,v 1.18 2003/12/28 22:24:12 atatat Exp $");
 
 #include "opt_sysv.h"
 #include "opt_multiprocessor.h"
@@ -1108,7 +1108,9 @@
 
 #ifndef MULTIPROCESSOR
 
-       if (namelen == 1 && name[0] == 0) {
+       if (namelen == 1) {
+               if (name[0] != 0)
+                       return (ENOENT);
                /*
                 * you're allowed to ask for the zero'th processor
                 */
@@ -1147,7 +1149,7 @@
                break;
        case 1:
                if (name[0] < 0 || name[0] >= n)
-                       return (EINVAL); /* ENOSUCHPROCESSOR */
+                       return (ENOENT); /* ENOSUCHPROCESSOR */
                node.sysctl_size = sizeof(u_int64_t) * CPUSTATES;
                n = name[0];
                /*



Home | Main Index | Thread Index | Old Index