summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGHC GitLab CI <ghc-ci@gitlab-haskell.org>2020-11-26 01:06:32 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-11-29 15:33:54 -0500
commit2793cfdc8f7dca8461149d54882286a76f52ff84 (patch)
tree86b82357e01bd005ead62fade383bada079e180a
parent8a4d8fb62abde3b79043e8915ee538aaabe2d97c (diff)
downloadhaskell-2793cfdc8f7dca8461149d54882286a76f52ff84.tar.gz
OSThreads: Fix error code checking
pthread_join returns its error code and apparently doesn't set errno.
-rw-r--r--rts/posix/OSThreads.c5
1 files 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);
}
}