From cd7027e6bea0e9d1894d9d79d64a838069bf3e26 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Wed, 12 Sep 2012 09:46:41 +0400 Subject: [PATCH] Eliminate 'unused value' compiler warning in GC_stop_world (Pthreads) * 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pthread_stop_world.c b/pthread_stop_world.c index a0132030..d9231b4a 100644 --- a/pthread_stop_world.c +++ b/pthread_stop_world.c @@ -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) { -- 2.40.0