From: Bart Van Assche Date: Sat, 4 Jan 2020 21:59:02 +0000 (-0800) Subject: helper_thread: Complain if select() fails X-Git-Tag: fio-3.18~22^2~2 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=700ad386aa886fe4b38432f25aa8ee318031d95a;p=fio.git helper_thread: Complain if select() fails This patch suppresses the following Coverity complaint: CID 280687: Error handling issues (CHECKED_RETURN) Calling "select(1, &rfds, NULL, &efds, &timeout)" without checking return value. This library function may fail and return an error code. Signed-off-by: Bart Van Assche --- diff --git a/helper_thread.c b/helper_thread.c index ad2e83b4..78749855 100644 --- a/helper_thread.c +++ b/helper_thread.c @@ -176,7 +176,10 @@ static void *helper_thread_main(void *data) FD_SET(hd->pipe[0], &rfds); FD_ZERO(&efds); FD_SET(hd->pipe[0], &efds); - select(1, &rfds, NULL, &efds, &timeout); + ret = select(1, &rfds, NULL, &efds, &timeout); + if (ret < 0) + log_err("fio: select() call in helper thread failed: %s", + strerror(errno)); if (read_from_pipe(hd->pipe[0], &action, sizeof(action)) < 0) action = 0;