* thread.cc (semaphore::_getvalue): Set *sval as appropriate. Set errno and
return -1 on error.
This commit is contained in:
		| @@ -1,3 +1,9 @@ | ||||
| 2013-09-25  Christopher Faylor  <me.cygwin2013@cgf.cx> | ||||
| 	    Paul Kunysch  <paul.kunysch@emsys.de> | ||||
|  | ||||
| 	* thread.cc (semaphore::_getvalue): Set *sval as appropriate.  Set | ||||
| 	errno and return -1 on error. | ||||
|  | ||||
| 2013-08-31  Corinna Vinschen  <corinna@vinschen.de> | ||||
|  | ||||
| 	* include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Belatedly bump | ||||
|   | ||||
| @@ -185,7 +185,7 @@ sem_timedwait (sem_t * sem, const struct timespec *abstime) | ||||
| } | ||||
|  | ||||
| int | ||||
| sem_post (sem_t * sem) | ||||
| sem_post (sem_t *sem) | ||||
| { | ||||
|   return semaphore::post (sem); | ||||
| } | ||||
|   | ||||
| @@ -3443,9 +3443,19 @@ semaphore::_getvalue (int *sval) | ||||
|  | ||||
|   status = NtQuerySemaphore (win32_obj_id, SemaphoreBasicInformation, &sbi, | ||||
| 			     sizeof sbi, NULL); | ||||
|   int res; | ||||
|   if (NT_SUCCESS (status)) | ||||
|     return sbi.CurrentCount; | ||||
|   return startvalue; | ||||
|     { | ||||
|       *sval = sbi.CurrentCount; | ||||
|       res = 0; | ||||
|     } | ||||
|   else | ||||
|     { | ||||
|       *sval = startvalue; | ||||
|       __seterrno_from_nt_status (status); | ||||
|       res = -1; | ||||
|     } | ||||
|   return res; | ||||
| } | ||||
|  | ||||
| int | ||||
|   | ||||
		Reference in New Issue
	
	Block a user