Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/intrctl fix: incorrect sysctlbyname(3) error handling.



details:   https://anonhg.NetBSD.org/src/rev/646f3be4ecd0
branches:  trunk
changeset: 346786:646f3be4ecd0
user:      knakahara <knakahara%NetBSD.org@localhost>
date:      Wed Aug 03 08:28:09 2016 +0000

description:
fix: incorrect sysctlbyname(3) error handling.

pointed out by nonaka@n.o

diffstat:

 usr.sbin/intrctl/intrctl_io.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r f1541b29f0b9 -r 646f3be4ecd0 usr.sbin/intrctl/intrctl_io.c
--- a/usr.sbin/intrctl/intrctl_io.c     Wed Aug 03 08:25:38 2016 +0000
+++ b/usr.sbin/intrctl/intrctl_io.c     Wed Aug 03 08:28:09 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intrctl_io.c,v 1.1 2015/08/17 06:42:46 knakahara Exp $ */
+/*     $NetBSD: intrctl_io.c,v 1.2 2016/08/03 08:28:09 knakahara Exp $ */
 
 /*
  * Copyright (c) 2015 Internet Initiative Japan Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: intrctl_io.c,v 1.1 2015/08/17 06:42:46 knakahara Exp $");
+__RCSID("$NetBSD: intrctl_io.c,v 1.2 2016/08/03 08:28:09 knakahara Exp $");
 
 #include <sys/sysctl.h>
 #include <sys/intrio.h>
@@ -63,7 +63,7 @@
                error = sysctlbyname("kern.intr.list", buf, &buf_size, NULL, 0);
                if (error >= 0)
                        return buf;
-               else if (error == -ENOMEM) {
+               else if (errno == ENOMEM) {
                        void *temp;
 
                        temp = realloc(buf, buf_size);



Home | Main Index | Thread Index | Old Index