diff options
author | Damien George <damien.p.george@gmail.com> | 2017-06-20 17:14:48 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-06-20 17:14:48 +1000 |
commit | e6782428becd3163aa978d889adb78cb9c014b09 (patch) | |
tree | 3b791c99e571a455e9b7d860893e709d19f3ac68 | |
parent | 1686346d53051d77daa662f7cc85614cc4ada06a (diff) |
cc3200: Initialise variable to zero to prevent compiler warnings.
-rw-r--r-- | cc3200/mods/modusocket.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cc3200/mods/modusocket.c b/cc3200/mods/modusocket.c index bef421a30..036682b49 100644 --- a/cc3200/mods/modusocket.c +++ b/cc3200/mods/modusocket.c @@ -264,7 +264,7 @@ STATIC int wlan_socket_settimeout(mod_network_socket_obj_t *s, mp_uint_t timeout int ret = sl_SetSockOpt(s->sock_base.sd, SL_SOL_SOCKET, SL_SO_NONBLOCKING, &option, sizeof(option)); if (ret != 0) { - *_errno = ret; + *_errno = convert_sl_errno(ret); return -1; } @@ -661,9 +661,9 @@ STATIC mp_obj_t socket_settimeout(mp_obj_t self_in, mp_obj_t timeout_in) { } else { timeout = mp_obj_get_int(timeout_in); } - int _errno; + int _errno = 0; if (wlan_socket_settimeout(self, timeout, &_errno) != 0) { - mp_raise_OSError(-_errno); + mp_raise_OSError(_errno); } return mp_const_none; } |