Source-Changes-HG archive

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

[src/trunk]: src/tests/lib/libc/sys Skip kqueue_unsupported_fd test if /dev/d...



details:   https://anonhg.NetBSD.org/src/rev/63c81290549e
branches:  trunk
changeset: 335986:63c81290549e
user:      isaki <isaki%NetBSD.org@localhost>
date:      Thu Feb 05 13:55:37 2015 +0000

description:
Skip kqueue_unsupported_fd test if /dev/drvctl is not configured
in the kernel.  PR bin/49644.

XXX Ideally, it's better to modify to use more generic device file.

diffstat:

 tests/lib/libc/sys/t_kevent.c |  14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diffs (35 lines):

diff -r b7ce955fbcb0 -r 63c81290549e tests/lib/libc/sys/t_kevent.c
--- a/tests/lib/libc/sys/t_kevent.c     Thu Feb 05 13:27:18 2015 +0000
+++ b/tests/lib/libc/sys/t_kevent.c     Thu Feb 05 13:55:37 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_kevent.c,v 1.6 2012/11/29 09:13:44 martin Exp $ */
+/*     $NetBSD: t_kevent.c,v 1.7 2015/02/05 13:55:37 isaki Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_kevent.c,v 1.6 2012/11/29 09:13:44 martin Exp $");
+__RCSID("$NetBSD: t_kevent.c,v 1.7 2015/02/05 13:55:37 isaki Exp $");
 
 #include <sys/types.h>
 #include <sys/event.h>
@@ -153,8 +153,14 @@
        struct kevent ev;
 
        fd = open(DRVCTLDEV, O_RDONLY);
-       if (fd == -1 && errno == ENOENT)
-               atf_tc_skip("no " DRVCTLDEV " available for testing");
+       if (fd == -1) {
+               switch (errno) {
+               case ENOENT:
+               case ENXIO:
+                       atf_tc_skip("no " DRVCTLDEV " available for testing");
+                       break;
+               }
+       }
        ATF_REQUIRE(fd != -1);
        ATF_REQUIRE((kq = kqueue()) != -1);
 



Home | Main Index | Thread Index | Old Index