* thread.cc (semaphore::init, destroy, close): Standards conformance

fix.  On a failure, return -1 and set errno.
	* thread.h (semaphore::terminate): Save errno since semaphore::close()
	may now modify it.
This commit is contained in:
Corinna Vinschen
2011-03-29 07:49:25 +00:00
parent 471bbbe240
commit 056b8e60cd
3 changed files with 35 additions and 7 deletions

View File

@@ -21,6 +21,7 @@ details. */
#include <limits.h>
#include "security.h"
#include <errno.h>
#include "cygerrno.h"
enum cw_sig_wait
{
@@ -641,6 +642,7 @@ public:
}
static void terminate ()
{
save_errno save;
semaphores.for_each (&semaphore::_terminate);
}