Skip to content

Commit 21f31e9

Browse files
pfalconAnas Nashif
authored andcommitted
net: sockets: Handle EINTR return from k_poll()
In 90b471f, there was a change to make k_poll() return EINTR error if it was cancelled with k_fifo_cancel_wait(). Handle this change, or otherwise sockets EOF handling was broken. Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
1 parent 3689107 commit 21f31e9

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
@@ -303,7 +303,8 @@ static inline ssize_t zsock_recv_stream(struct net_context *ctx,
303303
}
304304

305305
res = _k_fifo_wait_non_empty(&ctx->recv_q, timeout);
306-
if (res && res != -EAGAIN) {
306+
/* EAGAIN when timeout expired, EINTR when cancelled */
307+
if (res && res != -EAGAIN && res != -EINTR) {
307308
errno = -res;
308309
return -1;
309310
}

0 commit comments

Comments
 (0)