From c121118bc4b5cd7b8f154b14be7e2e0398054818 Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Tue, 24 Jan 2023 19:37:58 +0300 Subject: [PATCH] tests: Silence a warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In case the OS does not support epoll and kqueue, we get the warning: gio/tests/pollable.c: In function ‘test_pollable_unix_nulldev’: gio/tests/pollable.c:266:7: warning: unused variable ‘fd’ [-Wunused-variable] 266 | int fd; Get rid of it. Signed-off-by: Sergey Bugaev --- gio/tests/pollable.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gio/tests/pollable.c b/gio/tests/pollable.c index 56dfa3a31..540f200c6 100644 --- a/gio/tests/pollable.c +++ b/gio/tests/pollable.c @@ -263,14 +263,12 @@ test_pollable_unix_file (void) static void test_pollable_unix_nulldev (void) { - int fd; - g_test_summary ("Test that /dev/null is not considered pollable, but only if " "on a system where we are able to tell it apart from devices " "that actually implement poll"); #if defined (HAVE_EPOLL_CREATE) || defined (HAVE_KQUEUE) - fd = g_open ("/dev/null", O_RDWR, 0); + int fd = g_open ("/dev/null", O_RDWR, 0); g_assert_cmpint (fd, !=, -1); g_assert_not_pollable (fd);