forked from external/yambar
module/xkb: handle poll() failures
This commit is contained in:
parent
ffa86d84a5
commit
96c75b7f73
1 changed files with 8 additions and 1 deletions
|
@ -399,7 +399,14 @@ event_loop(struct module *mod, xcb_connection_t *conn, int xkb_event_base)
|
|||
};
|
||||
|
||||
/* Use poll() since xcb_wait_for_events() doesn't return on signals */
|
||||
poll(pfds, sizeof(pfds) / sizeof(pfds[0]), -1);
|
||||
if (poll(pfds, sizeof(pfds) / sizeof(pfds[0]), -1) < 0) {
|
||||
if (errno == EINTR)
|
||||
continue;
|
||||
|
||||
LOG_ERRNO("failed to poll");
|
||||
break;
|
||||
}
|
||||
|
||||
if (pfds[0].revents & POLLIN) {
|
||||
ret = true;
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue