From: Christian Dywan Date: Fri, 12 Feb 2010 01:16:27 +0000 (+0100) Subject: Use g_unlink for G_FILE_CREATE_REPLACE_DESTINATION with Glib < 2.20 X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c21807bc4a4453986e1f81c31c68b71e236bacd2;p=midori Use g_unlink for G_FILE_CREATE_REPLACE_DESTINATION with Glib < 2.20 --- diff --git a/extensions/web-cache.c b/extensions/web-cache.c index 4e4d07cd..33c34299 100644 --- a/extensions/web-cache.c +++ b/extensions/web-cache.c @@ -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)