From 8f42658f29687c5e45296c06d259de132f0c8fe5 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Wed, 27 Dec 2017 11:09:48 +0300 Subject: [PATCH] Fix error code in abort message if sem_wait failed in start_world (NetBSD) * pthread_stop_world.c [GC_NETBSD_THREADS_WORKAROUND] (GC_start_world): Print errno instead of the value returned by sem_wait if the latter has failed; remove "code" local variable. --- pthread_stop_world.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pthread_stop_world.c b/pthread_stop_world.c index 690d22f6..43bee5c6 100644 --- a/pthread_stop_world.c +++ b/pthread_stop_world.c @@ -1053,12 +1053,10 @@ GC_INNER void GC_start_world(void) } # ifdef GC_NETBSD_THREADS_WORKAROUND for (i = 0; i < n_live_threads; i++) { - int code; - - while (0 != (code = sem_wait(&GC_restart_ack_sem))) { + while (0 != sem_wait(&GC_restart_ack_sem)) { if (errno != EINTR) { ABORT_ARG1("sem_wait() for restart handler failed", - ": errcode= %d", code); + ": errcode= %d", errno); } } } -- 2.50.1