summaryrefslogtreecommitdiffstats
path: root/cpukit/posix
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1996-08-27 15:19:33 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1996-08-27 15:19:33 +0000
commit5a2348090fa0223748723a50608fc3f285790fac (patch)
tree17fa98b51f7ee0d402bb382fc47ccb8ba9c5a844 /cpukit/posix
parentChanged all EFAULTS to EINVALs (diff)
downloadrtems-5a2348090fa0223748723a50608fc3f285790fac.tar.bz2
check that we were passed a valid mutex and ignore errors from the
later pthread_mutex_lock. This makes our behavior more compatible with that of FSU pthreads.
Diffstat (limited to 'cpukit/posix')
-rw-r--r--cpukit/posix/src/cond.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/cpukit/posix/src/cond.c b/cpukit/posix/src/cond.c
index 4e87cf5c55..e9ff4711dc 100644
--- a/cpukit/posix/src/cond.c
+++ b/cpukit/posix/src/cond.c
@@ -370,6 +370,12 @@ int _POSIX_Condition_variables_Wait_support(
Objects_Locations location;
int status;
+ if ( !_POSIX_Mutex_Get( mutex, &location ) ) {
+ return EINVAL;
+ }
+
+ _Thread_Unnest_dispatch();
+
the_cond = _POSIX_Condition_variables_Get( cond, &location );
switch ( location ) {
case OBJECTS_ERROR:
@@ -388,10 +394,12 @@ int _POSIX_Condition_variables_Wait_support(
the_cond->Mutex = *mutex;
status = pthread_mutex_unlock( mutex );
+/* XXX ignore this for now
if ( status ) {
_Thread_Enable_dispatch();
return EINVAL;
}
+*/
_Thread_queue_Enter_critical_section( &the_cond->Wait_queue );
_Thread_Executing->Wait.return_code = 0;