From: Francis Deslauriers Date: Mon, 1 Nov 2021 19:31:26 +0000 (-0400) Subject: Fix: Tests: unchecked `close()` return value X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=abfc9c9b42c8cafee93f23ddb70a19f3cce21985;p=lttng-tools.git Fix: Tests: unchecked `close()` return value CID 1465101 (#1 of 1): Unchecked return value (CHECKED_RETURN) 9. check_return: Calling close without checking return value (as is done elsewhere 177 out of 185 times). CID 1465100 (#1 of 1): Unchecked return value (CHECKED_RETURN) 4. check_return: Calling close without checking return value (as is done elsewhere 177 out of 185 times) CID 1465099 (#1 of 1): Unchecked return value (CHECKED_RETURN) 4. check_return: Calling close without checking return value (as is done elsewhere 177 out of 185 times). CID 1465098 (#1 of 1): Unchecked return value (CHECKED_RETURN) 4. check_return: Calling close without checking return value (as is done elsewhere 177 out of 185 times). CID 1465097 (#1 of 1): Unchecked return value (CHECKED_RETURN) 4. check_return: Calling close without checking return value (as is done elsewhere 177 out of 185 times). Reported-by: Coverity Scan Signed-off-by: Francis Deslauriers Signed-off-by: Jérémie Galarneau Change-Id: I8e2552c75ab7cec5aa3707e2c1c4d9f2484b501a --- diff --git a/tests/regression/kernel/select_poll_epoll.c b/tests/regression/kernel/select_poll_epoll.c index b1eaf6045..d0d7e4aea 100644 --- a/tests/regression/kernel/select_poll_epoll.c +++ b/tests/regression/kernel/select_poll_epoll.c @@ -302,7 +302,10 @@ void test_epoll(void) } error: - close(epollfd); + ret = close(epollfd); + if (ret) { + perror("close"); + } end: return; } @@ -347,7 +350,10 @@ void test_pepoll(void) } error: - close(epollfd); + ret = close(epollfd); + if (ret) { + perror("close"); + } end: return; } @@ -579,7 +585,10 @@ void epoll_pwait_invalid_pointer(void) } error: - close(epollfd); + ret = close(epollfd); + if (ret) { + perror("close"); + } end: return; } @@ -625,7 +634,10 @@ void epoll_pwait_int_max(void) } error: - close(epollfd); + ret = close(epollfd); + if (ret) { + perror("close"); + } end: return; } @@ -840,7 +852,10 @@ error_unmap: } error: - close(epollfd); + ret = close(epollfd); + if (ret) { + perror("close"); + } end: return; }