8000 esp32/modsocket: Convert EADDRINUSE error code from lwip return value. · boris93/micropython@5a755ac · GitHub
[go: up one dir, main page]

Skip to content

Commit 5a755ac

Browse files
committed
esp32/modsocket: Convert EADDRINUSE error code from lwip return value.
1 parent 5f91933 commit 5a755ac

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ports/esp32/modsocket.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,9 @@ void usocket_events_handler(void) {
155155

156156
NORETURN static void exception_from_errno(int _errno) {
157157
// Here we need to convert from lwip errno values to MicroPython's standard ones
158-
if (_errno == EINPROGRESS) {
158+
if (_errno == EADDRINUSE) {
159+
_errno = MP_EADDRINUSE;
160+
} else if (_errno == EINPROGRESS) {
159161
_errno = MP_EINPROGRESS;
160162
}
161163
mp_raise_OSError(_errno);

0 commit comments

Comments
 (0)
0