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

This commit is contained in:
Paul Sokolovsky 2016-02-28 02:14:49 +02:00
parent ba8f7d5171
commit 0779409d0d
1 changed files with 2 additions and 1 deletions

View File

@ -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;
}
}