]> Dogcows Code - chaz/openbox/blobdiff - openbox/debug.c
Merge branch 'backport' into work
[chaz/openbox] / openbox / debug.c
index 749bc32e297f4c314b6fc18da66acc6ee5b06d6b..42644868ca78619416f678c257c8ea05458aa85a 100644 (file)
 #include <stdio.h>
 #include <errno.h>
 
+#ifdef HAVE_UNISTD_H
+#  include <unistd.h>
+#endif
+
 static gboolean  enabled_types[OB_DEBUG_TYPE_NUM] = {FALSE};
 static FILE     *log_file = NULL;
 static guint     rr_handler_id = 0;
@@ -48,6 +52,8 @@ void ob_debug_startup(void)
     else {
         gchar *name = g_build_filename(obt_paths_cache_home(p),
                                        "openbox", "openbox.log", NULL);
+        /* unlink it before opening to remove competition */
+        unlink(name);
         log_file = fopen(name, "w");
         g_free(name);
     }
This page took 0.028092 seconds and 4 git commands to generate.