zsock_poll_internal() iterates through all fds to call ZFD_IOCTL_POLL_UPDATE on them. In cases when -EAGAIN is returned from one of such syscalls (which happens for example for TLS sockets when in the middle of a TLS handshake) whole fds array is iterated once again. This means that ZFD_IOCTL_POLL_UPDATE can be called more than once for a single preceding ZFD_IOCTL_POLL_PREPARE operation. This resulted in error in nsos_adapt_poll_remove() call, which was not intended to be called twice. In case ZFD_IOCTL_POLL_UPDATE is called second time, update 'revents' just by calling poll() syscall on the host (Linux) side with 0 timeout. Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev> |
||
|---|---|---|
| .. | ||
| canbus.c | ||
| CMakeLists.txt | ||
| Kconfig | ||
| loopback.c | ||
| nsos.h | ||
| nsos_adapt.c | ||
| nsos_errno.c | ||
| nsos_errno.h | ||
| nsos_fcntl.c | ||
| nsos_fcntl.h | ||
| nsos_netdb.c | ||
| nsos_netdb.h | ||
| nsos_sockets.c | ||
| ppp.c | ||
| slip.c | ||
| slip.h | ||