Commit 8626d76a authored by Erik de Castro Lopo's avatar Erik de Castro Lopo Committed by Ben Gamari
Browse files

rtx/posix/Itimer.c: Handle return value of `read`

On Ubuntu libc's `read` function is marked with attribute
`warn_unused_result` which was causing build failures on
Harbourmaster.

Test Plan: validate on Harbourmaster

Reviewers: austin, hvr, bgamari

Reviewed By: hvr, bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1993

GHC Trac Issues: #11697
parent 06b70ffc
......@@ -202,7 +202,8 @@ static void *itimer_thread_func(void *_handle_tick)
while (1) {
if (USE_TIMERFD_FOR_ITIMER) {
read(timerfd, &nticks, sizeof(nticks));
if (read(timerfd, &nticks, sizeof(nticks)) != sizeof(nticks))
sysErrorBelch("Itimer: read(timer_fd) failed");
} else {
usleep(TimeToUS(itimer_interval));
}
......
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