mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-26 07:17:23 +00:00
[client] x11: handle EINTR properly in epoll loop
This commit is contained in:
parent
dca5da02a0
commit
9c5e34df0f
@ -27,6 +27,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/epoll.h>
|
#include <sys/epoll.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
#include <X11/extensions/XInput2.h>
|
#include <X11/extensions/XInput2.h>
|
||||||
#include <X11/extensions/scrnsaver.h>
|
#include <X11/extensions/scrnsaver.h>
|
||||||
@ -748,6 +749,9 @@ static int x11EventThread(void * unused)
|
|||||||
int nfds = epoll_wait(epollfd, events, 1, 100);
|
int nfds = epoll_wait(epollfd, events, 1, 100);
|
||||||
if (nfds == -1)
|
if (nfds == -1)
|
||||||
{
|
{
|
||||||
|
if (errno == EINTR)
|
||||||
|
continue;
|
||||||
|
|
||||||
close(epollfd);
|
close(epollfd);
|
||||||
DEBUG_ERROR("epoll_wait failure");
|
DEBUG_ERROR("epoll_wait failure");
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user