diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-04-08 18:17:08 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-04-09 16:18:44 -0400 |
commit | dce50062e35d3246b63fba9357dea6313c23c780 (patch) | |
tree | 7f6dbc52d64e7e85bede82c738fa74b6a383064c /rts/posix | |
parent | 390751768104cd3d2cb57e2037062916476ebd10 (diff) | |
download | haskell-dce50062e35d3246b63fba9357dea6313c23c780.tar.gz |
Rts: show errno on failure (#18033)
Diffstat (limited to 'rts/posix')
-rw-r--r-- | rts/posix/itimer/Pthread.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/rts/posix/itimer/Pthread.c b/rts/posix/itimer/Pthread.c index 083775bab2..d4b0342795 100644 --- a/rts/posix/itimer/Pthread.c +++ b/rts/posix/itimer/Pthread.c @@ -110,13 +110,13 @@ static void *itimer_thread_func(void *_handle_tick) timerfd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC); if (timerfd == -1) { - barf("timerfd_create"); + barf("timerfd_create: %s", strerror(errno)); } if (!TFD_CLOEXEC) { fcntl(timerfd, F_SETFD, FD_CLOEXEC); } if (timerfd_settime(timerfd, 0, &it, NULL)) { - barf("timerfd_settime"); + barf("timerfd_settime: %s", strerror(errno)); } #endif @@ -124,7 +124,7 @@ static void *itimer_thread_func(void *_handle_tick) if (USE_TIMERFD_FOR_ITIMER) { if (read(timerfd, &nticks, sizeof(nticks)) != sizeof(nticks)) { if (errno != EINTR) { - barf("Itimer: read(timerfd) failed"); + barf("Itimer: read(timerfd) failed: %s", strerror(errno)); } } } else { @@ -170,7 +170,7 @@ initTicker (Time interval, TickProc handle_tick) pthread_setname_np(thread, "ghc_ticker"); #endif } else { - barf("Itimer: Failed to spawn thread"); + barf("Itimer: Failed to spawn thread: %s", strerror(errno)); } } @@ -204,7 +204,7 @@ exitTicker (bool wait) // wait for ticker to terminate if necessary if (wait) { if (pthread_join(thread, NULL)) { - sysErrorBelch("Itimer: Failed to join"); + sysErrorBelch("Itimer: Failed to join: %s", strerror(errno)); } closeMutex(&mutex); closeCondition(&start_cond); |