unlink the log file when opening it so you get a new file

This commit is contained in:
Dana Jansens 2008-01-28 10:21:29 -05:00
parent e0eb926ac2
commit 45e2039a58

View file

@ -48,6 +48,8 @@ void ob_debug_startup(void)
else { else {
gchar *name = g_build_filename(obt_paths_cache_home(p), gchar *name = g_build_filename(obt_paths_cache_home(p),
"openbox", "openbox.log", NULL); "openbox", "openbox.log", NULL);
/* unlink it before opening to remove competition */
unlink(name);
log_file = fopen(name, "w"); log_file = fopen(name, "w");
g_free(name); g_free(name);
} }