diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2016-02-28 02:14:49 +0200 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2016-03-12 11:42:15 +0700 |
commit | 0779409d0da1633d9abce5ed0a349aea36edb0c4 (patch) | |
tree | b86ed2decf2abe8bd596a04bc2e4eeff10b45a42 | |
parent | ba8f7d5171a6dcbd7a32600c31b943cc96fb4b1e (diff) | |
download | micropython-0779409d0da1633d9abce5ed0a349aea36edb0c4.tar.gz micropython-0779409d0da1633d9abce5ed0a349aea36edb0c4.zip |
extmod/modlwip: lwip_tcp_receive: Properly map lwIP error to POSIX errno.
-rw-r--r-- | extmod/modlwip.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/extmod/modlwip.c b/extmod/modlwip.c index 820c15b72e..e3fc5068dd 100644 --- a/extmod/modlwip.c +++ b/extmod/modlwip.c @@ -396,7 +396,8 @@ STATIC mp_uint_t lwip_tcp_receive(lwip_socket_obj_t *socket, byte *buf, mp_uint_ return 0; } } else if (socket->state != STATE_CONNECTED) { - *_errno = -socket->state; + assert(socket->state < 0); + *_errno = error_lookup_table[-socket->state]; return -1; } } |