Skip to content
Snippets Groups Projects
Commit 0779409d authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

extmod/modlwip: lwip_tcp_receive: Properly map lwIP error to POSIX errno.

parent ba8f7d51
No related branches found
No related tags found
No related merge requests found
...@@ -396,7 +396,8 @@ STATIC mp_uint_t lwip_tcp_receive(lwip_socket_obj_t *socket, byte *buf, mp_uint_ ...@@ -396,7 +396,8 @@ STATIC mp_uint_t lwip_tcp_receive(lwip_socket_obj_t *socket, byte *buf, mp_uint_
return 0; return 0;
} }
} else if (socket->state != STATE_CONNECTED) { } else if (socket->state != STATE_CONNECTED) {
*_errno = -socket->state; assert(socket->state < 0);
*_errno = error_lookup_table[-socket->state];
return -1; return -1;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment