From 18d98e30f960273c440eac752dfb2983d182b210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Fri, 8 Apr 2022 00:11:23 +0400 Subject: [PATCH] gio/tests: close leaked fd MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also fixes some of the test on win32, since it won't delete files that are opened. Signed-off-by: Marc-André Lureau --- gio/tests/gdbus-peer.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gio/tests/gdbus-peer.c b/gio/tests/gdbus-peer.c index 2f2caf77a..7ca8bb715 100644 --- a/gio/tests/gdbus-peer.c +++ b/gio/tests/gdbus-peer.c @@ -1682,6 +1682,7 @@ test_nonce_tcp (void) gchar *nonce_file; gboolean res; const gchar *address; + int fd; test_guid = g_dbus_generate_guid (); loop = g_main_loop_new (NULL, FALSE); @@ -1780,7 +1781,9 @@ test_nonce_tcp (void) g_assert (c == NULL); /* Recreate the nonce-file so we can ensure the server deletes it when stopped. */ - g_assert_cmpint (g_creat (nonce_file, 0600), !=, -1); + fd = g_creat (nonce_file, 0600); + g_assert_cmpint (fd, !=, -1); + g_close (fd, NULL); g_dbus_server_stop (server); g_object_unref (server);