]> 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>
Tue, 16 Jan 2018 21:34:56 +0000 (00:34 +0300)
* 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 690d22f607217788ab321da95543672aa52a2cf8..43bee5c638451fe3e54fb5c334fe9931d0a275e7 100644 (file)
@@ -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);
           }
         }
       }