summaryrefslogtreecommitdiffhomepage
path: root/mixlib
diff options
context:
space:
mode:
Diffstat (limited to 'mixlib')
-rw-r--r--mixlib/mix_config.c7
1 files 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);