Diff of /sem_trywait.c [1beb00] .. [9e61bc]  Maximize  Restore

Switch to side-by-side view

--- a/sem_trywait.c
+++ b/sem_trywait.c
@@ -85,6 +85,15 @@
     }
   else if ((result = pthread_mutex_lock (&s->lock)) == 0)
     {
+      /* See sem_destroy.c
+       */
+     if (*sem == NULL)
+        {
+          (void) pthread_mutex_unlock (&s->lock);
+          errno = EINVAL;
+          return -1;
+        }
+
       if (s->value > 0)
 	{
 	  s->value--;

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks