From: mtheall Date: Sat, 24 Jan 2015 17:48:50 +0000 (-0600) Subject: Fix poll() to only update revents. X-Git-Tag: v0.4.0~9 X-Git-Url: https://chaos.moe/g/?a=commitdiff_plain;h=f87d35042c45b4593eab35b746e9c02cbec645c6;p=corbenik%2Fctrulib.git Fix poll() to only update revents. --- diff --git a/libctru/source/services/soc/soc_poll.c b/libctru/source/services/soc/soc_poll.c index 4bdbb2f..80b6514 100644 --- a/libctru/source/services/soc/soc_poll.c +++ b/libctru/source/services/soc/soc_poll.c @@ -1,6 +1,7 @@ #include "soc_common.h" #include #include +#include int poll(struct pollfd *fds, nfds_t nfds, int timeout) { @@ -47,7 +48,7 @@ int poll(struct pollfd *fds, nfds_t nfds, int timeout) saved_threadstorage[1] = cmdbuf[0x104>>2]; cmdbuf[0x100>>2] = (size<<14) | 2; - cmdbuf[0x104>>2] = (u32)fds; + cmdbuf[0x104>>2] = (u32)tmp_fds; if((ret = svcSendSyncRequest(SOCU_handle)) != 0) { @@ -55,6 +56,11 @@ int poll(struct pollfd *fds, nfds_t nfds, int timeout) return ret; } + for(i = 0; i < nfds; ++i) + { + fds[i].revents = tmp_fds[i].revents; + } + free(tmp_fds); cmdbuf[0x100>>2] = saved_threadstorage[0];