From 00a5f7285706ac4fb0fb264bda1dc4d6c3057f8c Mon Sep 17 00:00:00 2001 From: o9000 Date: Fri, 21 Jul 2017 12:03:49 +0200 Subject: [PATCH] Create dirs with parents --- src/config.c | 6 +++--- src/tint2conf/main.c | 2 +- src/tint2conf/theme_view.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/config.c b/src/config.c index bc845aa..6316b59 100644 --- a/src/config.c +++ b/src/config.c @@ -1367,7 +1367,7 @@ gboolean config_read_default_path() // (https://specifications.freedesktop.org/basedir-spec/basedir-spec-0.6.html) // if the user's config directory does not exist, we should create it with permissions set to 0700. if (!g_file_test(g_get_user_config_dir(), G_FILE_TEST_IS_DIR)) - g_mkdir(g_get_user_config_dir(), 0700); + g_mkdir_with_parents(g_get_user_config_dir(), 0700); gchar *path2 = 0; system_dirs = g_get_system_config_dirs(); @@ -1384,7 +1384,7 @@ gboolean config_read_default_path() // copy file in user directory (path1) gchar *dir = g_build_filename(g_get_user_config_dir(), "tint2", NULL); if (!g_file_test(dir, G_FILE_TEST_IS_DIR)) - g_mkdir(dir, 0700); + g_mkdir_with_parents(dir, 0700); g_free(dir); path1 = g_build_filename(g_get_user_config_dir(), "tint2", "tint2rc", NULL); @@ -1400,7 +1400,7 @@ gboolean config_read_default_path() // generate config file gchar *dir = g_build_filename(g_get_user_config_dir(), "tint2", NULL); if (!g_file_test(dir, G_FILE_TEST_IS_DIR)) - g_mkdir(dir, 0700); + g_mkdir_with_parents(dir, 0700); g_free(dir); path1 = g_build_filename(g_get_user_config_dir(), "tint2", "tint2rc", NULL); diff --git a/src/tint2conf/main.c b/src/tint2conf/main.c index 3bc7f32..4e6d9ad 100644 --- a/src/tint2conf/main.c +++ b/src/tint2conf/main.c @@ -227,7 +227,7 @@ int main(int argc, char **argv) { gchar *tint2_config_dir = g_build_filename(g_get_user_config_dir(), "tint2", NULL); if (!g_file_test(tint2_config_dir, G_FILE_TEST_IS_DIR)) - g_mkdir(tint2_config_dir, 0700); + g_mkdir_with_parents(tint2_config_dir, 0700); g_free(tint2_config_dir); } diff --git a/src/tint2conf/theme_view.c b/src/tint2conf/theme_view.c index c9848d2..edad023 100644 --- a/src/tint2conf/theme_view.c +++ b/src/tint2conf/theme_view.c @@ -177,7 +177,7 @@ gboolean update_snapshot(gpointer ignored) { gchar *tint2_cache_dir = g_build_filename(g_get_user_cache_dir(), "tint2", NULL); if (!g_file_test(tint2_cache_dir, G_FILE_TEST_IS_DIR)) - g_mkdir(tint2_cache_dir, 0700); + g_mkdir_with_parents(tint2_cache_dir, 0700); g_free(tint2_cache_dir); }