]> granicus.if.org Git - gc/commitdiff
Fix error code in abort message if sem_wait failed in start_world (NetBSD)
authorIvan Maidanski <ivmai@mail.ru>
Wed, 27 Dec 2017 08:09:48 +0000 (11:09 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 19 Jan 2018 16:12:22 +0000 (19:12 +0300)
(backport of commit 8f42658f from 'release-7_6')

* 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

index e8467344421e86000631aac921e88c3233587d12..daa00f878c360e09696c8c9ce74dc4fa827ebedc 100644 (file)
@@ -800,9 +800,6 @@ GC_INNER void GC_start_world(void)
       register int n_live_threads = 0;
       register int result;
 #   endif
-#   ifdef GC_NETBSD_THREADS_WORKAROUND
-      int code;
-#   endif
 
 #   ifdef DEBUG_THREADS
       GC_log_printf("World starting\n");
@@ -853,10 +850,10 @@ GC_INNER void GC_start_world(void)
     }
 #   ifdef GC_NETBSD_THREADS_WORKAROUND
       for (i = 0; i < n_live_threads; i++) {
-        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);
           }
         }
       }