From 9c64e90517ac5f42c5830eec9dd0a0f12e64deaf Mon Sep 17 00:00:00 2001 From: Olaf Bergmann Date: Fri, 19 Jun 2020 15:19:08 +0200 Subject: [PATCH] net.c: fix check_return false positive from Coverity In coap_io_do_epoll(), read() is called after timeout to clear the file descriptor associated with the firing timer. As this function is only called for its side effect, the result is ignored. Coverity scan reports this as check_return event. A cast to void has been added to document that the result is ignored on purpose. This fixes CID 1495728. --- src/net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net.c b/src/net.c index e96cf8f4..e4e977a2 100644 --- a/src/net.c +++ b/src/net.c @@ -1586,7 +1586,7 @@ coap_io_do_epoll(coap_context_t *ctx, struct epoll_event *events, size_t nevents */ uint64_t count; - read(ctx->eptimerfd, &count, sizeof(count)); + (void)read(ctx->eptimerfd, &count, sizeof(count)); /* And process any timed out events */ coap_ticks(&now); coap_io_prepare_epoll(ctx, now);