mirror of
https://github.com/libretro/RetroArch
synced 2025-01-29 18:32:44 +00:00
(Network/Vita) Fix epoll's timeout parameter (#14216)
This commit is contained in:
parent
a6a4b845a4
commit
07e03c86fa
@ -222,7 +222,7 @@ int socket_select(int nfds, fd_set *readfds, fd_set *writefds,
|
||||
int epoll_fd;
|
||||
SceNetEpollEvent *events = NULL;
|
||||
int event_count = 0;
|
||||
int timeout_ms = -1;
|
||||
int timeout_us = -1;
|
||||
int ret = -1;
|
||||
|
||||
if (nfds < 0 || nfds > 1024)
|
||||
@ -319,10 +319,11 @@ int socket_select(int nfds, fd_set *readfds, fd_set *writefds,
|
||||
if (errorfds)
|
||||
FD_ZERO(errorfds);
|
||||
|
||||
/* Vita's epoll takes a microsecond timeout parameter. */
|
||||
if (timeout)
|
||||
timeout_ms = (int)((timeout->tv_usec / 1000) + (timeout->tv_sec * 1000));
|
||||
timeout_us = (int)(timeout->tv_usec + (timeout->tv_sec * 1000000));
|
||||
|
||||
ret = sceNetEpollWait(epoll_fd, events, event_count, timeout_ms);
|
||||
ret = sceNetEpollWait(epoll_fd, events, event_count, timeout_us);
|
||||
if (ret <= 0)
|
||||
goto done;
|
||||
|
||||
@ -421,7 +422,8 @@ int socket_poll(struct pollfd *fds, unsigned nfds, int timeout)
|
||||
|
||||
#undef ALLOC_EVENTS
|
||||
|
||||
ret = sceNetEpollWait(epoll_fd, events, event_count, timeout);
|
||||
/* Vita's epoll takes a microsecond timeout parameter. */
|
||||
ret = sceNetEpollWait(epoll_fd, events, event_count, timeout * 1000);
|
||||
if (ret <= 0)
|
||||
goto done;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user