Module Name: src
Committed By: christos
Date: Mon Jan 16 16:23:41 UTC 2017
Modified Files:
src/tests/lib/libpthread: t_mutex.c
Log Message:
PR/51888: Ngie Cooper: more error checking, missing includes
To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/tests/lib/libpthread/t_mutex.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/lib/libpthread/t_mutex.c
diff -u src/tests/lib/libpthread/t_mutex.c:1.14 src/tests/lib/libpthread/t_mutex.c:1.15
--- src/tests/lib/libpthread/t_mutex.c:1.14 Mon Oct 31 19:51:20 2016
+++ src/tests/lib/libpthread/t_mutex.c Mon Jan 16 11:23:41 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: t_mutex.c,v 1.14 2016/10/31 23:51:20 christos Exp $ */
+/* $NetBSD: t_mutex.c,v 1.15 2017/01/16 16:23:41 christos Exp $ */
/*
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,8 +29,10 @@
#include <sys/cdefs.h>
__COPYRIGHT("@(#) Copyright (c) 2008\
The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_mutex.c,v 1.14 2016/10/31 23:51:20 christos Exp $");
+__RCSID("$NetBSD: t_mutex.c,v 1.15 2017/01/16 16:23:41 christos Exp $");
+#include <sys/time.h> /* For timespecadd */
+#include <inttypes.h> /* For UINT16_MAX */
#include <pthread.h>
#include <stdio.h>
#include <string.h>
@@ -570,9 +572,16 @@ ATF_TC_BODY(mutexattr2, tc)
int min_prio = sched_get_priority_min(SCHED_FIFO);
for (int i = min_prio; i <= max_prio; i++) {
int prioceiling;
+ int protocol;
+
+ PTHREAD_REQUIRE(pthread_mutexattr_getprotocol(&mattr,
+ &protocol));
+
+ printf("priority: %d\nprotocol: %d\n", i, protocol);
PTHREAD_REQUIRE(pthread_mutexattr_setprioceiling(&mattr, i));
PTHREAD_REQUIRE(pthread_mutexattr_getprioceiling(&mattr,
&prioceiling));
+ printf("prioceiling: %d\n", prioceiling);
ATF_REQUIRE_EQ(i, prioceiling);
}
}