From 89226f608e9186d52e88de8fee52a479ad0f08db Mon Sep 17 00:00:00 2001 From: Francis Deslauriers Date: Tue, 1 Oct 2019 16:22:37 -0400 Subject: [PATCH] Fix: test_utils_compat_poll.c: Unchecked return value MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Coverity report: CID 1401360 (#1 of 1): Unchecked return value (CHECKED_RETURN)4. check_return: Calling compat_epoll_create without checking return value (as is done elsewhere 6 out of 7 times). Reported-by: Coverity (1401360) Unchecked return value Signed-off-by: Francis Deslauriers Signed-off-by: Jérémie Galarneau --- tests/unit/test_utils_compat_poll.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/unit/test_utils_compat_poll.c b/tests/unit/test_utils_compat_poll.c index 24a74d76f..b0bd623d1 100644 --- a/tests/unit/test_utils_compat_poll.c +++ b/tests/unit/test_utils_compat_poll.c @@ -49,9 +49,9 @@ int lttng_opt_mi; #define MAGIC_VALUE ((char) 0x5A) #ifdef HAVE_EPOLL -#define NUM_TESTS 46 +#define NUM_TESTS 47 #else -#define NUM_TESTS 45 +#define NUM_TESTS 46 #endif #ifdef HAVE_EPOLL @@ -101,7 +101,7 @@ void test_add_del(void) ok(lttng_poll_add(&poll_events, 1, LPOLLIN) != 0, "Adding to uninitialized structure fails"); ok(lttng_poll_add(&poll_events, -1, LPOLLIN) != 0, "Adding invalid FD fails"); - lttng_poll_create(&poll_events, 1, 0); + ok(lttng_poll_create(&poll_events, 1, 0) == 0, "Create a poll set succeeds"); ok(LTTNG_POLL_GETNB(&poll_events) == 0, "Set created empty"); ok(lttng_poll_add(NULL, 1, LPOLLIN) != 0, "Adding to NULL set fails"); -- 2.34.1