Skip to content

Commit e678242

Browse files
committed
cc3200: Initialise variable to zero to prevent compiler warnings.
1 parent 1686346 commit e678242

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

cc3200/mods/modusocket.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ STATIC int wlan_socket_settimeout(mod_network_socket_obj_t *s, mp_uint_t timeout
264264

265265
int ret = sl_SetSockOpt(s->sock_base.sd, SL_SOL_SOCKET, SL_SO_NONBLOCKING, &option, sizeof(option));
266266
if (ret != 0) {
267-
*_errno = ret;
267+
*_errno = convert_sl_errno(ret);
268268
return -1;
269269
}
270270

@@ -661,9 +661,9 @@ STATIC mp_obj_t socket_settimeout(mp_obj_t self_in, mp_obj_t timeout_in) {
661661
} else {
662662
timeout = mp_obj_get_int(timeout_in);
663663
}
664-
int _errno;
664+
int _errno = 0;
665665
if (wlan_socket_settimeout(self, timeout, &_errno) != 0) {
666-
mp_raise_OSError(-_errno);
666+
mp_raise_OSError(_errno);
667667
}
668668
return mp_const_none;
669669
}

0 commit comments

Comments
 (0)