Create epoll_waiting

This commit is contained in:
twinaphex 2015-11-30 18:08:00 +01:00
parent ecbfc72e9b
commit 54655c37cd
4 changed files with 10 additions and 2 deletions

View File

@ -1,4 +1,5 @@
#include <stdio.h>
#include <unistd.h>
#include "epoll_common.h"
@ -33,3 +34,8 @@ void epoll_free(bool is_joypad)
epoll_inited = false;
epoll_first_inited_is_joypad = false;
}
int epoll_waiting(struct epoll_event *events, int maxevents, int timeout)
{
return epoll_wait(g_epoll, events, maxevents, timeout);
}

View File

@ -29,4 +29,6 @@ bool epoll_new(bool is_joypad);
void epoll_free(bool is_joypad);
int epoll_waiting(struct epoll_event *events, int maxevents, int timeout);
#endif

View File

@ -365,7 +365,7 @@ static void udev_input_poll(void *data)
while (udev_mon_hotplug_available())
udev_input_handle_hotplug(udev);
ret = epoll_wait(g_epoll, events, ARRAY_SIZE(events), 0);
ret = epoll_waiting(events, ARRAY_SIZE(events), 0);
for (i = 0; i < ret; i++)
{

View File

@ -194,7 +194,7 @@ static void linuxraw_joypad_poll(void)
struct epoll_event events[MAX_USERS + 1];
retry:
ret = epoll_wait(g_epoll, events, MAX_USERS + 1, 0);
ret = epoll_waiting(events, MAX_USERS + 1, 0);
if (ret < 0 && errno == EINTR)
goto retry;