mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 20:58:22 +00:00
poll syscall: fix return from wait
This commit is contained in:
@@ -73,7 +73,7 @@ syscallret_t syscall_poll(context_t *, pollfd_t *fds, size_t nfds, int timeoutms
|
||||
if (eventcount == 0 && timeoutms != 0) {
|
||||
ret.errno = poll_dowait(&desc, (timeoutms == -1 ? 0 : timeoutms) * 1000);
|
||||
if (ret.errno == 0 && desc.event) {
|
||||
int fd = ((uintptr_t)desc.event - (uintptr_t)desc.data) / sizeof(pollfd_t);
|
||||
int fd = ((uintptr_t)desc.event - (uintptr_t)desc.data) / sizeof(polldata_t);
|
||||
fdsbuff[fd].revents = desc.data[fd].revents;
|
||||
eventcount = 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user