From 2793cfdc8f7dca8461149d54882286a76f52ff84 Mon Sep 17 00:00:00 2001 From: GHC GitLab CI Date: Thu, 26 Nov 2020 01:06:32 +0000 Subject: OSThreads: Fix error code checking pthread_join returns its error code and apparently doesn't set errno. --- rts/posix/OSThreads.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rts/posix/OSThreads.c b/rts/posix/OSThreads.c index 6347e8ce7a..be2b596c35 100644 --- a/rts/posix/OSThreads.c +++ b/rts/posix/OSThreads.c @@ -401,8 +401,9 @@ interruptOSThread (OSThreadId id) void joinOSThread (OSThreadId id) { - if (pthread_join(id, NULL) != 0) { - sysErrorBelch("joinOSThread: error %d", errno); + int ret = pthread_join(id, NULL); + if (ret != 0) { + sysErrorBelch("joinOSThread: error %d", ret); } } -- cgit v1.2.1