summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/userpref.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/userpref.c b/src/userpref.c
index b2fdd2d..41b11bc 100644
--- a/src/userpref.c
+++ b/src/userpref.c
@@ -260,10 +260,11 @@ int get_host_certificate(gnutls_datum_t* host_cert) {
/** Creates a freedesktop compatible configuration directory for libiphone.
*/
inline void create_config_dir() {
- gchar* config_dir;
-
- config_dir = g_build_path(G_DIR_SEPARATOR_S, g_get_user_config_dir(), LIBIPHONE_CONF_DIR, NULL);
- g_mkdir_with_parents(config_dir, 0755);
+ gchar* config_dir = g_build_path(G_DIR_SEPARATOR_S, g_get_user_config_dir(), LIBIPHONE_CONF_DIR, NULL);
+
+ if (!g_file_test(config_dir, (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR) ))
+ g_mkdir_with_parents(config_dir, 0755);
+
g_free(config_dir);
}