Skip to content

Commit 1de4289

Browse files
committed
esp32/modsocket.c: fixups for micropython#10
1 parent b0ff8be commit 1de4289

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

esp32/modsocket.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ STATIC mp_obj_t socket_close(const mp_obj_t arg0) {
6464
}
6565
STATIC MP_DEFINE_CONST_FUN_OBJ_1(socket_close_obj, socket_close);
6666

67-
static int exception_from_errno(int _errno) {
67+
NORETURN static void exception_from_errno(int _errno) {
6868
// XXX add more specific exceptions
6969
mp_raise_OSError(_errno);
7070
}
@@ -182,7 +182,7 @@ STATIC mp_obj_t socket_recv(mp_uint_t n_args, const mp_obj_t *args) {
182182
size_t len = (n_args > 1) ? MIN(mp_obj_get_int(args[1]), sizeof(buf)) : sizeof(buf);
183183
int x = lwip_recvfrom(self->fd, buf, len, 0, NULL, NULL);
184184
if (x >= 0) return mp_obj_new_bytes(buf, x);
185-
if (errno == EWOULDBLOCK) return b'';
185+
if (errno == EWOULDBLOCK) return mp_obj_new_bytes(buf, 0);
186186
exception_from_errno(errno);
187187
}
188188
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socket_recv_obj, 1, 2, socket_recv);

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