[buoh/wip/jtojnar/gi-docgen: 1/3] Use mkdir_with_parents for creating config directories




commit 9c8b2feb9da5399b1fea95d2580c0c8ce3e38da9
Author: Jan Tojnar <jtojnar gmail com>
Date:   Wed May 4 01:25:50 2022 +0200

    Use mkdir_with_parents for creating config directories
    
    Otherwise starting the app might fail when the XDG directories do not exist yet (e.g. in fresh build 
sandbox on CI).

 src/buoh-application.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/buoh-application.c b/src/buoh-application.c
index 4deaded..f8a3352 100644
--- a/src/buoh-application.c
+++ b/src/buoh-application.c
@@ -347,7 +347,7 @@ buoh_application_create_user_dir (BuohApplication *buoh)
 
         if (!g_file_test (buoh->datadir, G_FILE_TEST_IS_DIR)) {
                 buoh_debug ("User directory doesn't exist, creating it ...");
-                if (g_mkdir (buoh->datadir, 0755) != 0) {
+                if (g_mkdir_with_parents (buoh->datadir, 0755) != 0) {
                         g_error ("Cannot create user's directory");
                 }
         }
@@ -368,7 +368,7 @@ buoh_application_create_user_dir (BuohApplication *buoh)
 
         if (!g_file_test (cache_dir, G_FILE_TEST_IS_DIR)) {
                 buoh_debug ("Cache directory doesn't exist, creating it ...");
-                if (g_mkdir (cache_dir, 0755) != 0) {
+                if (g_mkdir_with_parents (cache_dir, 0755) != 0) {
                         g_error ("Cannot create cache directory");
                 }
         }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]