mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-08-09 20:24:14 +00:00
[client] x11: handle EINTR properly in epoll loop
This commit is contained in:
@@ -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;
|
||||||
|
Reference in New Issue
Block a user