Skip to content

Commit 8c22527

Browse files
committed
net: sockets: poll: Handle EINTR return from k_poll
This is similar to change which was done in 21f31e9, unfortunately this case was missed. Fixes: #9032 Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
1 parent 69aa9e2 commit 8c22527

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

subsys/net/lib/sockets/sockets.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,8 @@ int _impl_zsock_poll(struct zsock_pollfd *fds, int nfds, int timeout)
717717
}
718718

719719
ret = k_poll(poll_events, pev - poll_events, timeout);
720-
if (ret != 0 && ret != -EAGAIN) {
720+
/* EAGAIN when timeout expired, EINTR when cancelled (i.e. EOF) */
721+
if (ret != 0 && ret != -EAGAIN && ret != -EINTR) {
721722
errno = -ret;
722723
return -1;
723724
}

0 commit comments

Comments
 (0)