diff options
author | Erik de Castro Lopo <erikd@mega-nerd.com> | 2016-03-11 10:40:50 +0100 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2016-03-11 13:20:19 +0100 |
commit | 8626d76a723c2514bab91afb82e6b8b94fed2a2b (patch) | |
tree | 205631f4201527e2f3c645718bd9e080bc3b779b /rts/posix | |
parent | 06b70ffc7b17bd34ea771b8be11574c4002db6c8 (diff) | |
download | haskell-8626d76a723c2514bab91afb82e6b8b94fed2a2b.tar.gz |
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
Diffstat (limited to 'rts/posix')
-rw-r--r-- | rts/posix/Itimer.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/rts/posix/Itimer.c b/rts/posix/Itimer.c index f6c00a6007..b8332957af 100644 --- a/rts/posix/Itimer.c +++ b/rts/posix/Itimer.c @@ -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)); } |