From f3330a28efe3658d1331ba1fce83858526867dfd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Thu, 1 Feb 2018 16:30:26 +0100 Subject: [PATCH] io: fix a no-return with -DNDEBUG --- daemon/io.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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) -- 2.47.3