From c169f7ae83cf6e8de77ead416ebbf118ba5e7371 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 9 Jul 2019 18:40:51 +0530 Subject: [PATCH] Retry writing to wakeupfd on EAGAIN as well --- glfw/backend_utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glfw/backend_utils.c b/glfw/backend_utils.c index 0d98d8e55..7181dc052 100644 --- a/glfw/backend_utils.c +++ b/glfw/backend_utils.c @@ -246,9 +246,9 @@ void wakeupEventLoop(EventLoopData *eld) { #ifdef HAS_EVENT_FD static const int64_t value = 1; - while (write(eld->wakeupFd, &value, sizeof value) < 0 && errno == EINTR); + while (write(eld->wakeupFd, &value, sizeof value) < 0 && (errno == EINTR || errno == EAGAIN)); #else - while (write(eld->wakeupFds[1], "w", 1) < 0 && errno == EINTR); + while (write(eld->wakeupFds[1], "w", 1) < 0 && (errno == EINTR || errno == EAGAIN)); #endif }