[rtems commit] psxsignal06: Fix bug where mutex not locked and add EPERM error check
Joel Sherrill
joel at rtems.org
Wed Dec 11 01:42:09 UTC 2013
Module: rtems
Branch: master
Commit: 0b59942156b6e6f8b5aaba7568413cd85138e524
Changeset: http://git.rtems.org/rtems/commit/?id=0b59942156b6e6f8b5aaba7568413cd85138e524
Author: Joel Sherrill <joel.sherrill at oarcorp.com>
Date: Tue Dec 10 19:48:28 2013 -0600
psxsignal06: Fix bug where mutex not locked and add EPERM error check
This test formerly had a bug in that it attempted to wait on a
condition variable with a Mutex that was not locked. This is
undefined by POSIX. But a recent change to match GNU/Linux behavior
resulted in finding a bug in the test.
---
testsuites/psxtests/psxsignal06/init.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/testsuites/psxtests/psxsignal06/init.c b/testsuites/psxtests/psxsignal06/init.c
index da2b31e..810783c 100644
--- a/testsuites/psxtests/psxsignal06/init.c
+++ b/testsuites/psxtests/psxsignal06/init.c
@@ -1,5 +1,5 @@
/*
- * COPYRIGHT (c) 1989-2012.
+ * COPYRIGHT (c) 1989-2013.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -56,6 +56,9 @@ void *TestThread(
act.sa_flags = 0;
sigaction( SIGUSR1, &act, NULL );
+ status = pthread_mutex_lock( &MutexId );
+ rtems_test_assert( !status );
+
/* interrupting condition wait returns 0 */
puts( "Test: pthread_cond_wait - OK" );
status = pthread_cond_wait( &CondVarId, &MutexId );
More information about the vc
mailing list