Source-Changes-HG archive

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

[src/trunk]: src/tests/modules Fix stupid thinko when checking for the availa...



details:   https://anonhg.NetBSD.org/src/rev/7f9204cff35d
branches:  trunk
changeset: 781106:7f9204cff35d
user:      martin <martin%NetBSD.org@localhost>
date:      Mon Aug 20 08:07:52 2012 +0000

description:
Fix stupid thinko when checking for the availability of options MODULAR
and permission to load modules.

diffstat:

 tests/modules/t_modctl.c |  13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diffs (36 lines):

diff -r 91527cc6387f -r 7f9204cff35d tests/modules/t_modctl.c
--- a/tests/modules/t_modctl.c  Mon Aug 20 07:45:24 2012 +0000
+++ b/tests/modules/t_modctl.c  Mon Aug 20 08:07:52 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_modctl.c,v 1.11 2012/08/19 20:54:56 martin Exp $     */
+/*     $NetBSD: t_modctl.c,v 1.12 2012/08/20 08:07:52 martin Exp $     */
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: t_modctl.c,v 1.11 2012/08/19 20:54:56 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: t_modctl.c,v 1.12 2012/08/20 08:07:52 martin Exp $");
 
 #include <sys/module.h>
 #include <sys/sysctl.h>
@@ -70,12 +70,13 @@
        int err;
 
        err = modctl(MODCTL_EXISTS, 0);
-       if (err == ENOSYS)
+       if (err == 0) return;
+       if (errno == ENOSYS)
                atf_tc_skip("Kernel does not have 'options MODULAR'.");
-       else if (err == EPERM)
+       else if (errno == EPERM)
                atf_tc_skip("Module loading administratively forbidden");
-       ATF_REQUIRE_EQ_MSG(err, 0, "unexpected error code %d from "
-           "modctl(MODCTL_EXISTS, 0)", err);
+       ATF_REQUIRE_EQ_MSG(errno, 0, "unexpected error %d from "
+           "modctl(MODCTL_EXISTS, 0)", errno);
 }
 
 static bool



Home | Main Index | Thread Index | Old Index