#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;
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);
}
g_log_set_handler("Openbox", G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL |
G_LOG_FLAG_RECURSION, log_handler, NULL);
+ obt_paths_unref(p);
g_free(dir);
}