summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--extmod/modlwip.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/extmod/modlwip.c b/extmod/modlwip.c
index 820c15b72..e3fc5068d 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;
}
}