From 0912334f54f5cdf1d7784032e64e23495d854bed Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Wed, 17 May 2017 00:21:22 +0300 Subject: [PATCH] zephyr/modusocket: getaddrinfo: Use RAISE_ERRNO for proper error decoding. --- zephyr/modusocket.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/zephyr/modusocket.c b/zephyr/modusocket.c index c4e6529b8f..fbc6301364 100644 --- a/zephyr/modusocket.c +++ b/zephyr/modusocket.c @@ -572,10 +572,7 @@ STATIC mp_obj_t mod_getaddrinfo(size_t n_args, const mp_obj_t *args) { int status; for (int i = 2; i--;) { int type = (family != AF_INET6 ? DNS_QUERY_TYPE_A : DNS_QUERY_TYPE_AAAA); - status = dns_get_addr_info(host, type, NULL, dns_resolve_cb, &state, 3000); - if (status < 0) { - mp_raise_OSError(status); - } + RAISE_ERRNO(dns_get_addr_info(host, type, NULL, dns_resolve_cb, &state, 3000)); k_sem_take(&state.sem, K_FOREVER); if (family != 0) { break;