(Network/Vita) Do not multiply negative timeout values (#14217)

This commit is contained in:
Cthulhu-throwaway 2022-07-25 02:55:08 -03:00 committed by GitHub
parent 262b0601e2
commit 97e3ef6ec7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -423,7 +423,10 @@ int socket_poll(struct pollfd *fds, unsigned nfds, int timeout)
#undef ALLOC_EVENTS
/* Vita's epoll takes a microsecond timeout parameter. */
ret = sceNetEpollWait(epoll_fd, events, event_count, timeout * 1000);
if (timeout > 0)
timeout *= 1000;
ret = sceNetEpollWait(epoll_fd, events, event_count, timeout);
if (ret <= 0)
goto done;