]> spindle.queued.net Git - midori/commitdiff
Use g_unlink for G_FILE_CREATE_REPLACE_DESTINATION with Glib < 2.20
authorChristian Dywan <christian@twotoasts.de>
Fri, 12 Feb 2010 01:16:27 +0000 (02:16 +0100)
committerChristian Dywan <christian@twotoasts.de>
Fri, 12 Feb 2010 01:19:54 +0000 (02:19 +0100)
extensions/web-cache.c

index 4e4d07cd537bead7b647129513ecc652f8528c07..33c34299c14f37324ba92bc82e4155d14d5761ce 100644 (file)
@@ -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)