diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2001-07-05 23:37:49 +0000 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2001-07-05 23:37:49 +0000 |
commit | 551ec2bb5fb690a9bfa7db1691b54946163473b6 (patch) | |
tree | db91aa54a474a4f58b43d4beb30db21f743f5d78 | |
parent | 51b640d12df21cbf76ef3dd556316d461aa4abf3 (diff) | |
download | mdk-551ec2bb5fb690a9bfa7db1691b54946163473b6.tar.gz mdk-551ec2bb5fb690a9bfa7db1691b54946163473b6.tar.bz2 |
use mix_stat_dir
-rw-r--r-- | mixlib/mix_config.c | 7 |
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); |