Skip to content

Commit 588fa2b

Browse files
robert-hhdpgeorge
authored andcommitted
extmod/modlwip: Always set the lwip_socket_ioctl() return value.
If the return value is set only when certain condition are true, the compiler sometimes raises an error. Signed-off-by: robert-hh <robert@hammelrath.com>
1 parent b7d7a26 commit 588fa2b

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

extmod/modlwip.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1579,13 +1579,12 @@ static mp_uint_t lwip_socket_ioctl(mp_obj_t self_in, mp_uint_t request, uintptr_
15791579
}
15801580

15811581
lwip_socket_obj_t *socket = MP_OBJ_TO_PTR(self_in);
1582-
mp_uint_t ret;
1582+
mp_uint_t ret = 0;
15831583

15841584
MICROPY_PY_LWIP_ENTER
15851585

15861586
if (request == MP_STREAM_POLL) {
15871587
uintptr_t flags = arg;
1588-
ret = 0;
15891588

15901589
if (flags & MP_STREAM_POLL_RD) {
15911590
if (socket->state == STATE_LISTENING) {
@@ -1691,7 +1690,6 @@ static mp_uint_t lwip_socket_ioctl(mp_obj_t self_in, mp_uint_t request, uintptr_
16911690

16921691
socket->pcb.tcp = NULL;
16931692
socket->state = _ERR_BADF;
1694-
ret = 0;
16951693
}
16961694

16971695
MICROPY_PY_LWIP_EXIT

0 commit comments

Comments
 (0)