From: Vladimír Čunát Date: Thu, 1 Feb 2018 15:30:26 +0000 (+0100) Subject: io: fix a no-return with -DNDEBUG X-Git-Tag: v2.1.0~13^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f3330a28efe3658d1331ba1fce83858526867dfd;p=thirdparty%2Fknot-resolver.git io: fix a no-return with -DNDEBUG --- diff --git a/daemon/io.c b/daemon/io.c index 6a59a5ac0..13909a3a1 100644 --- a/daemon/io.c +++ b/daemon/io.c @@ -459,12 +459,15 @@ void io_release(uv_handle_t *handle) int io_start_read(uv_handle_t *handle) { - if (handle->type == UV_UDP) { + switch (handle->type) { + case UV_UDP: return uv_udp_recv_start((uv_udp_t *)handle, &handle_getbuf, &udp_recv); - } else if (handle->type == UV_TCP) { + case UV_TCP: return uv_read_start((uv_stream_t *)handle, &handle_getbuf, &tcp_recv); + default: + assert(!EINVAL); + return kr_error(EINVAL); } - assert(false); } int io_stop_read(uv_handle_t *handle)