diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2022-11-13 17:04:50 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2022-11-14 22:17:53 +0300 |
commit | 60183e2f34402a75d7a4a30ed7a0f71ae4b6c347 (patch) | |
tree | 9681bc03ccb863dae7144519ec43a8599bcf81c0 | |
parent | 800b29ecc448b4b589dc9fdf38699080c48a10d1 (diff) | |
download | bdwgc-60183e2f34402a75d7a4a30ed7a0f71ae4b6c347.tar.gz |
Fix use of unset errno after pthread_sigmask calls
(a cherry-pick of commit e55d1b99b from 'release-8_2')
* pthread_support.c [PARALLEL_MARK]
(GC_start_mark_threads_inner): Do not pass errno value to WARN() calls
(because pthread_create and pthread_sigmask do not set errno).
* win32_threads.c [PARALLEL_MARK && GC_PTHREADS_PARAMARK
&& !NO_MARKER_SPECIAL_SIGMASK] (GC_start_mark_threads_inner): Likewise.
-rw-r--r-- | pthread_support.c | 9 | ||||
-rw-r--r-- | win32_threads.c | 6 |
2 files changed, 5 insertions, 10 deletions
diff --git a/pthread_support.c b/pthread_support.c index 824740a6..e3027024 100644 --- a/pthread_support.c +++ b/pthread_support.c @@ -455,8 +455,7 @@ GC_INNER void GC_start_mark_threads_inner(void) # endif if (REAL_FUNC(pthread_sigmask)(SIG_BLOCK, &set, &oldset) < 0) { - WARN("pthread_sigmask set failed, no markers started," - " errno = %" WARN_PRIdPTR "\n", errno); + WARN("pthread_sigmask set failed, no markers started\n", 0); GC_markers_m1 = 0; (void)pthread_attr_destroy(&attr); return; @@ -469,8 +468,7 @@ GC_INNER void GC_start_mark_threads_inner(void) for (i = 0; i < available_markers_m1; ++i) { if (0 != REAL_FUNC(pthread_create)(GC_mark_threads + i, &attr, GC_mark_thread, (void *)(word)i)) { - WARN("Marker thread creation failed, errno = %" WARN_PRIdPTR "\n", - errno); + WARN("Marker thread creation failed\n", 0); /* Don't try to create other marker threads. */ GC_markers_m1 = i; break; @@ -480,8 +478,7 @@ GC_INNER void GC_start_mark_threads_inner(void) # ifndef NO_MARKER_SPECIAL_SIGMASK /* Restore previous signal mask. */ if (REAL_FUNC(pthread_sigmask)(SIG_SETMASK, &oldset, NULL) < 0) { - WARN("pthread_sigmask restore failed, errno = %" WARN_PRIdPTR "\n", - errno); + WARN("pthread_sigmask restore failed\n", 0); } # endif diff --git a/win32_threads.c b/win32_threads.c index 3e04445d..8b3e09e6 100644 --- a/win32_threads.c +++ b/win32_threads.c @@ -2032,8 +2032,7 @@ GC_INNER void GC_get_next_stack(char *start, char *limit, if (sigfillset(&set) != 0) ABORT("sigfillset failed"); if (pthread_sigmask(SIG_BLOCK, &set, &oldset) < 0) { - WARN("pthread_sigmask set failed, no markers started," - " errno = %" WARN_PRIdPTR "\n", errno); + WARN("pthread_sigmask set failed, no markers started\n", 0); GC_markers_m1 = 0; (void)pthread_attr_destroy(&attr); return; @@ -2057,8 +2056,7 @@ GC_INNER void GC_get_next_stack(char *start, char *limit, # ifndef NO_MARKER_SPECIAL_SIGMASK /* Restore previous signal mask. */ if (pthread_sigmask(SIG_SETMASK, &oldset, NULL) < 0) { - WARN("pthread_sigmask restore failed, errno = %" WARN_PRIdPTR "\n", - errno); + WARN("pthread_sigmask restore failed\n", 0); } # endif |