Use g_unlink for G_FILE_CREATE_REPLACE_DESTINATION with Glib < 2.20

This commit is contained in:
Christian Dywan 2010-02-12 02:16:27 +01:00
parent 902f836810
commit c21807bc4a

View file

@ -323,8 +323,14 @@ web_cache_mesage_got_headers_cb (SoupMessage* msg,
if (!web_cache_save_headers (msg, filename)) if (!web_cache_save_headers (msg, filename))
return; return;
#if GLIB_CHECK_VERSION (2, 20, 0)
ostream = (GOutputStream*)g_file_append_to (file, ostream = (GOutputStream*)g_file_append_to (file,
G_FILE_CREATE_PRIVATE | G_FILE_CREATE_REPLACE_DESTINATION, NULL, NULL); G_FILE_CREATE_PRIVATE | G_FILE_CREATE_REPLACE_DESTINATION, NULL, NULL);
#else
g_unlink (filename);
ostream = (GOutputStream*)g_file_append_to (file,
G_FILE_CREATE_PRIVATE, NULL, NULL);
#endif
g_object_unref (file); g_object_unref (file);
if (!ostream) if (!ostream)