diff options
author | Jon TURNEY <jon.turney@dronecode.org.uk> | 2011-04-19 22:51:20 +0400 |
---|---|---|
committer | Jon TURNEY <jon.turney@dronecode.org.uk> | 2011-04-19 22:51:20 +0400 |
commit | 11629685f117ef39ec7b0006160ce38042246159 (patch) | |
tree | 1a606b4246d5dd40af3d2555048593704a5b8ed7 /winsup | |
parent | ed240047f2ed06bf77ddca73ef8874fd99c414fc (diff) |
2011-04-02 Jon TURNEY <jon.turney@dronecode.org.uk>
* thread.cc (semaphore::init): We cannot reliably infer anything from
the existing contents of sem, so merely warn rather than return EBUSY
if it looks like we are reinitialising a semaphore.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 6 | ||||
-rw-r--r-- | winsup/cygwin/thread.cc | 9 |
2 files changed, 12 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index a97051ad1..fe817b4c9 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2011-04-02 Jon TURNEY <jon.turney@dronecode.org.uk> + + * thread.cc (semaphore::init): We cannot reliably infer anything from + the existing contents of sem, so merely warn rather than return EBUSY + if it looks like we are reinitialising a semaphore. + 2011-04-19 Corinna Vinschen <corinna@vinschen.de> * autoload.cc (GetConsoleWindow): Drop. diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc index 87167b7f9..2bd50658c 100644 --- a/winsup/cygwin/thread.cc +++ b/winsup/cygwin/thread.cc @@ -3209,11 +3209,14 @@ semaphore::_terminate () int semaphore::init (sem_t *sem, int pshared, unsigned int value) { - /* opengroup calls this undefined */ + /* + We can't tell the difference between reinitialising an + existing semaphore and initialising a semaphore who's + contents happen to be a valid pointer + */ if (is_good_object (sem)) { - set_errno(EBUSY); - return -1; + paranoid_printf ("potential attempt to reinitialise a semaphore"); } if (value > SEM_VALUE_MAX) |