Commit c7b1e93b authored by Ben Gamari's avatar Ben Gamari Committed by Ben Gamari

rts: Abort if timerfd read fails

Currently we belch some output to stderr but fail to abort, resulting in
a busy loop. Fixes #15292.

Test Plan:
 * Validate
 * try running program under environment without timerfd capabilities;
ensure we don't busy-loop

Reviewers: simonmar, erikd

Reviewed By: simonmar

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #15929

Differential Revision: https://phabricator.haskell.org/D4875
parent 63d474bb
......@@ -123,7 +123,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) {
sysErrorBelch("Itimer: read(timerfd) failed");
barf("Itimer: read(timerfd) failed");
}
}
} else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment