Skip to content

Commit 3da9d60

Browse files
committed
esp32/modsocket: Convert lwip errnos to uPy ones.
1 parent 3d4537c commit 3da9d60

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

esp32/modsocket.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include "py/objlist.h"
4242
#include "py/objstr.h"
4343
#include "py/runtime.h"
44+
#include "py/mperrno.h"
4445
#include "py/mphal.h"
4546
#include "py/stream.h"
4647
#include "lib/netutils/netutils.h"
@@ -59,7 +60,10 @@ typedef struct _socket_obj_t {
5960
} socket_obj_t;
6061

6162
NORETURN static void exception_from_errno(int _errno) {
62-
// XXX add more specific exceptions
63+
// Here we need to convert from lwip errno values to MicroPython's standard ones
64+
if (_errno == EINPROGRESS) {
65+
_errno = MP_EINPROGRESS;
66+
}
6367
mp_raise_OSError(_errno);
6468
}
6569

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy