summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimo@endlessm.com>2014-02-25 09:43:04 +0000
committerRichard Hughes <richard@hughsie.com>2014-02-25 09:43:04 +0000
commitb9cff29978113aefe3ad18521f383f12ab099a34 (patch)
tree340ebe58966ab69fbe69b517c3eceb892327f79d
parent0d64bbddaa0078ef148d609a3cfad854cf00d7de (diff)
downloadupower-b9cff29978113aefe3ad18521f383f12ab099a34.tar.gz
Create the history directory at runtime
In addition to build time - this increases compatibilty with OSTree, which starts out with an empty /var. Signed-off-by: Richard Hughes <richard@hughsie.com>
-rw-r--r--src/up-history.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/up-history.c b/src/up-history.c
index f9d0fdf..795b093 100644
--- a/src/up-history.c
+++ b/src/up-history.c
@@ -414,6 +414,7 @@ up_history_set_directory (UpHistory *history, const gchar *dir)
{
g_free (history->priv->dir);
history->priv->dir = g_strdup (dir);
+ g_mkdir_with_parents (dir, 0755);
}
/**
@@ -887,7 +888,8 @@ up_history_init (UpHistory *history)
history->priv->data_time_full = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
history->priv->data_time_empty = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
history->priv->max_data_age = UP_HISTORY_DEFAULT_MAX_DATA_AGE;
- history->priv->dir = g_build_filename (HISTORY_DIR, NULL);
+
+ up_history_set_directory (history, HISTORY_DIR);
}
/**