Retry writing to wakeupfd on EAGAIN as well

This commit is contained in:
Kovid Goyal 2019-07-09 18:40:51 +05:30
parent 7ab5244bf5
commit c169f7ae83
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -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
}