Windows does not like g_unlink() to be called on files whose file
descriptor is still open, so doing that would cause a permission
denied error. Since the fd is not used in that function after
acquiring the temp file, close it earlier before
g_file_set_contents(), so that it can complete successfully.
This fixes a number of GTK+ tests on Windows.
https://bugzilla.gnome.org/show_bug.cgi?id=719344
" </policy>\n"
"</busconfig>\n");
+ close (fd);
g_file_set_contents (path, contents->str, contents->len, &error);
g_assert_no_error (error);
g_string_free (contents, TRUE);
- close (fd);
-
return path;
}