X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fdebug.c;h=42644868ca78619416f678c257c8ea05458aa85a;hb=da5f4e08f5e77fe6fe54d65b668aa129150b281b;hp=749bc32e297f4c314b6fc18da66acc6ee5b06d6b;hpb=e0eb926ac20ca0e153c07c377206210c82a8768b;p=chaz%2Fopenbox diff --git a/openbox/debug.c b/openbox/debug.c index 749bc32e..42644868 100644 --- a/openbox/debug.c +++ b/openbox/debug.c @@ -26,6 +26,10 @@ #include #include +#ifdef HAVE_UNISTD_H +# include +#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); }