* pthread_stop_world.c (GC_restart_handler): Preserve errno value in
case of sem_post or GC_log_printf invocation inside.
STATIC void GC_restart_handler(int sig)
{
+# if defined(DEBUG_THREADS) || defined(GC_NETBSD_THREADS_WORKAROUND)
+ int old_errno = errno; /* Preserve errno value. */
+# endif
+
if (sig != SIG_THR_RESTART) ABORT("Bad signal in suspend_handler");
# ifdef GC_NETBSD_THREADS_WORKAROUND
# ifdef DEBUG_THREADS
GC_log_printf("In GC_restart_handler for %p\n", (void *)pthread_self());
# endif
+# if defined(DEBUG_THREADS) || defined(GC_NETBSD_THREADS_WORKAROUND)
+ errno = old_errno;
+# endif
}
#endif /* !GC_OPENBSD_THREADS && !NACL */