]> granicus.if.org Git - gc/commitdiff
Eliminate 'unused value' compiler warning in GC_stop_world (Pthreads)
authorIvan Maidanski <ivmai@mail.ru>
Wed, 12 Sep 2012 05:46:41 +0000 (09:46 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 12 Sep 2012 05:46:41 +0000 (09:46 +0400)
* pthread_stop_world.c (GC_stop_world): Eliminate
"assigned value never used" compiler warning for "code" local variable
in conditional statement checking sem_wait result.

pthread_stop_world.c

index a0132030b9e1674c6d40996e4737ecb0dd45b82f..d9231b4ac244e2866c92809d24e872df3ed9a51a 100644 (file)
@@ -620,7 +620,8 @@ GC_INNER void GC_stop_world(void)
 
     for (i = 0; i < n_live_threads; i++) {
       retry:
-        if (0 != (code = sem_wait(&GC_suspend_ack_sem))) {
+        code = sem_wait(&GC_suspend_ack_sem);
+        if (0 != code) {
           /* On Linux, sem_wait is documented to always return zero.    */
           /* But the documentation appears to be incorrect.             */
           if (errno == EINTR) {