mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
gio/tests: close leaked fd
Also fixes some of the test on win32, since it won't delete files that are opened. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
parent
a638b2bbd1
commit
18d98e30f9
@ -1682,6 +1682,7 @@ test_nonce_tcp (void)
|
|||||||
gchar *nonce_file;
|
gchar *nonce_file;
|
||||||
gboolean res;
|
gboolean res;
|
||||||
const gchar *address;
|
const gchar *address;
|
||||||
|
int fd;
|
||||||
|
|
||||||
test_guid = g_dbus_generate_guid ();
|
test_guid = g_dbus_generate_guid ();
|
||||||
loop = g_main_loop_new (NULL, FALSE);
|
loop = g_main_loop_new (NULL, FALSE);
|
||||||
@ -1780,7 +1781,9 @@ test_nonce_tcp (void)
|
|||||||
g_assert (c == NULL);
|
g_assert (c == NULL);
|
||||||
|
|
||||||
/* Recreate the nonce-file so we can ensure the server deletes it when stopped. */
|
/* 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_dbus_server_stop (server);
|
||||||
g_object_unref (server);
|
g_object_unref (server);
|
||||||
|
Loading…
Reference in New Issue
Block a user