From 6bd30a4cb90c406edfd141016e08b36804b98103 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Mon, 6 Jan 2014 10:05:48 +0800 Subject: [PATCH] glib/tests/keyfile.c: Use g_close() Use g_close() instead, as close() is really found in io.h on Windows, not unistd.h as on Unix, and hence unistd.h is not universally available. https://bugzilla.gnome.org/show_bug.cgi?id=719344 --- glib/tests/keyfile.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/glib/tests/keyfile.c b/glib/tests/keyfile.c index 546878321..8e428f4eb 100644 --- a/glib/tests/keyfile.c +++ b/glib/tests/keyfile.c @@ -3,7 +3,6 @@ #include #include #include -#include static GKeyFile * load_data (const gchar *data, @@ -1381,7 +1380,9 @@ test_save (void) file = g_strdup ("key_file_XXXXXX"); fd = g_mkstemp (file); g_assert (fd != -1); - close (fd); + ok = g_close (fd, &error); + g_assert (ok); + g_assert_no_error (error); ok = g_key_file_save_to_file (kf, file, &error); g_assert (ok); g_assert_no_error (error);