Fix the Keyfile Test on Windows
authorChun-wei Fan <fanchunwei@src.gnome.org>
Tue, 17 Dec 2013 02:58:15 +0000 (10:58 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Sat, 4 Jan 2014 02:42:28 +0000 (10:42 +0800)
commit3fd6edab66244b100c32dc0a8b0720fe61431dcc
treed8e87ca4295e4d56978d97a899939b23368b04ed
parent6448f875529bb6c79f64550b62c3e294c3a6efa5
Fix the Keyfile Test on Windows

Windows will not allow one to write to a temp file opened by g_mkstemp()
by opening another fd associated with it before one closes the fd that
is returned by g_mkstemp(), which will cause the test_save test to fail.

Fix this by using a variable to store the fd from g_mkstemp() and checking
it, and call close() on that variable before attempting to call
g_key_file_save_to_file() on the temp file as that will attempt to open
another fd (which would not work) associated with that temp file.

https://bugzilla.gnome.org/show_bug.cgi?id=719344
glib/tests/keyfile.c