Use g_unlink for G_FILE_CREATE_REPLACE_DESTINATION with Glib < 2.20
This commit is contained in:
parent
902f836810
commit
c21807bc4a
1 changed files with 6 additions and 0 deletions
|
@ -323,8 +323,14 @@ web_cache_mesage_got_headers_cb (SoupMessage* msg,
|
|||
if (!web_cache_save_headers (msg, filename))
|
||||
return;
|
||||
|
||||
#if GLIB_CHECK_VERSION (2, 20, 0)
|
||||
ostream = (GOutputStream*)g_file_append_to (file,
|
||||
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);
|
||||
|
||||
if (!ostream)
|
||||
|
|
Loading…
Reference in a new issue