summaryrefslogtreecommitdiff
path: root/src/lightdm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lightdm.c')
-rw-r--r--src/lightdm.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/lightdm.c b/src/lightdm.c
index d9ec9aff..3246b6ab 100644
--- a/src/lightdm.c
+++ b/src/lightdm.c
@@ -33,6 +33,7 @@
#include "shared-data-manager.h"
#include "user-list.h"
#include "login1.h"
+#include "log-file.h"
static gchar *config_path = NULL;
static GMainLoop *loop = NULL;
@@ -124,7 +125,7 @@ log_cb (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message,
static void
log_init (void)
{
- gchar *log_dir, *path, *old_path;
+ gchar *log_dir, *path;
log_timer = g_timer_new ();
@@ -133,13 +134,7 @@ log_init (void)
path = g_build_filename (log_dir, "lightdm.log", NULL);
g_free (log_dir);
- /* Move old file out of the way */
- old_path = g_strdup_printf ("%s.old", path);
- rename (path, old_path);
- g_free (old_path);
-
- /* Create new file and log to it */
- log_fd = open (path, O_WRONLY | O_CREAT | O_TRUNC, 0600);
+ log_fd = log_file_open (path, LOG_MODE_APPEND);
fcntl (log_fd, F_SETFD, FD_CLOEXEC);
g_log_set_default_handler (log_cb, NULL);