From 71a44cc27569fe77521ed0d2f0702e6ddd5f1f1a Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Tue, 10 Aug 2021 20:42:46 +0800 Subject: [PATCH] clocksd: handle EINTR on read() (#21892) * handle EINTR on read * Update selfdrive/clocksd/clocksd.cc Co-authored-by: Willem Melching Co-authored-by: Willem Melching --- selfdrive/clocksd/clocksd.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/selfdrive/clocksd/clocksd.cc b/selfdrive/clocksd/clocksd.cc index 951a92467..c24ffa41d 100644 --- a/selfdrive/clocksd/clocksd.cc +++ b/selfdrive/clocksd/clocksd.cc @@ -50,7 +50,10 @@ int main() { uint64_t expirations = 0; while (!do_exit && (err = read(timerfd, &expirations, sizeof(expirations)))) { - if (err < 0) break; + if (err < 0) { + if (errno == EINTR) continue; + break; + } #else // Just run at 1Hz on apple while (!do_exit) {