From 551ec2bb5fb690a9bfa7db1691b54946163473b6 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Thu, 5 Jul 2001 23:37:49 +0000 Subject: use mix_stat_dir --- mixlib/mix_config.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mixlib/mix_config.c b/mixlib/mix_config.c index 721e88e..d03e949 100644 --- a/mixlib/mix_config.c +++ b/mixlib/mix_config.c @@ -52,8 +52,7 @@ mix_config_new (const gchar *dirname, const gchar *filename) const gchar *autosave; FILE *f; - int k; - mix_config_t *result = g_new (mix_config_t, 1); + mix_config_t *result = NULL; if (DEF_DIRNAME_ == NULL) DEF_DIRNAME_ = g_strdup_printf ("%s/%s", g_get_home_dir (), DEF_DIR_); @@ -61,9 +60,9 @@ mix_config_new (const gchar *dirname, const gchar *filename) if (dirname == NULL) dirname = DEF_DIRNAME_; if (filename == NULL) filename = DEF_FILENAME_; - k = mkdir (dirname, S_IRWXU | S_IRWXG | S_IRWXO); - if (!k) g_message ("Configuration directory %s created\n", dirname); + if (!mix_stat_dir (dirname, "configuration")) return NULL; + result = g_new (mix_config_t, 1); result->filename = g_strdup_printf ("%s/%s", dirname, filename); result->items = g_hash_table_new (g_str_hash, g_str_equal); -- cgit v1.2.3