Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorRobert Collins <rbtcollins@hotmail.com>2002-02-28 16:50:41 +0300
committerRobert Collins <rbtcollins@hotmail.com>2002-02-28 16:50:41 +0300
commit062401c9b4bf8a203d7e694194307d84e351fce0 (patch)
tree8eedc5c349c466376c9b0529d2be5ea292b638b4 /winsup
parent5c48da9a28f11b00341d619499e7387f0df6ad83 (diff)
2002-02-28 Robert Collins <rbtcollins@hotmail.com>
* thread.cc (semaphore::TryWait): Set errno as required by posix 1003.1. (__sem_wait): Ditto. (__sem_trywait): Ditto.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/thread.cc15
2 files changed, 18 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index d9d5a9472..4e87a5718 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,9 @@
+2002-02-28 Robert Collins <rbtcollins@hotmail.com>
+
+ * thread.cc (semaphore::TryWait): Set errno as required by posix 1003.1.
+ (__sem_wait): Ditto.
+ (__sem_trywait): Ditto.
+
2002-02-27 Christopher Faylor <cgf@redhat.com>
* include/cygwin/version.h: Bump DLL minor number.
diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc
index ced5f6f80..5c44ca90a 100644
--- a/winsup/cygwin/thread.cc
+++ b/winsup/cygwin/thread.cc
@@ -807,7 +807,10 @@ semaphore::TryWait ()
*We probably need WaitForMultipleObjects here.
*/
if (WaitForSingleObject (win32_obj_id, 0) == WAIT_TIMEOUT)
- return EAGAIN;
+ {
+ set_errno (EAGAIN);
+ return -1;
+ }
currentvalue--;
return 0;
}
@@ -2213,7 +2216,10 @@ int
__sem_wait (sem_t *sem)
{
if (verifyable_object_isvalid (sem, SEM_MAGIC) != VALID_OBJECT)
- return EINVAL;
+ {
+ set_errno (EINVAL);
+ return -1;
+ }
(*sem)->Wait ();
return 0;
@@ -2223,7 +2229,10 @@ int
__sem_trywait (sem_t *sem)
{
if (verifyable_object_isvalid (sem, SEM_MAGIC) != VALID_OBJECT)
- return EINVAL;
+ {
+ set_errno (EINVAL);
+ return -1;
+ }
return (*sem)->TryWait ();
}