Source-Changes-HG archive

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

[src/trunk]: src/tests/lib/librt Do not fail but skip tests if POSIX semaphor...



details:   https://anonhg.NetBSD.org/src/rev/9acd2e20590d
branches:  trunk
changeset: 758563:9acd2e20590d
user:      njoly <njoly%NetBSD.org@localhost>
date:      Mon Nov 08 13:05:49 2010 +0000

description:
Do not fail but skip tests if POSIX semaphores are not supported.

diffstat:

 tests/lib/librt/t_sem.c |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (38 lines):

diff -r cf329e939ac5 -r 9acd2e20590d tests/lib/librt/t_sem.c
--- a/tests/lib/librt/t_sem.c   Mon Nov 08 12:42:35 2010 +0000
+++ b/tests/lib/librt/t_sem.c   Mon Nov 08 13:05:49 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_sem.c,v 1.1 2010/07/16 13:56:32 jmmv Exp $ */
+/* $NetBSD: t_sem.c,v 1.2 2010/11/08 13:05:49 njoly Exp $ */
 
 /*
  * Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
 #include <sys/cdefs.h>
 __COPYRIGHT("@(#) Copyright (c) 2008, 2010\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_sem.c,v 1.1 2010/07/16 13:56:32 jmmv Exp $");
+__RCSID("$NetBSD: t_sem.c,v 1.2 2010/11/08 13:05:49 njoly Exp $");
 
 #include <sys/wait.h>
 
@@ -83,7 +83,8 @@
        int val;
        sem_t *sem_b;
 
-       ATF_REQUIRE(sysconf(_SC_SEMAPHORES) != -1);
+       if (sysconf(_SC_SEMAPHORES) == -1)
+               atf_tc_skip("POSIX semaphores not supported");
 
        sem_b = sem_open("/sem_b", O_CREAT | O_EXCL, 0644, 0);
        ATF_REQUIRE(sem_b != SEM_FAILED);
@@ -123,6 +124,9 @@
 
        pid_t pid;
 
+       if (sysconf(_SC_SEMAPHORES) == -1)         
+               atf_tc_skip("POSIX semaphores not supported");
+
        sem_a = sem_open("/sem_a", O_CREAT | O_EXCL, 0644, 0);
        ATF_REQUIRE(sem_a != SEM_FAILED);
 



Home | Main Index | Thread Index | Old Index