diff options
Diffstat (limited to 'camel/camel-session.c')
-rw-r--r-- | camel/camel-session.c | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/camel/camel-session.c b/camel/camel-session.c index 3e6630a9c8..6f6896c885 100644 --- a/camel/camel-session.c +++ b/camel/camel-session.c @@ -354,26 +354,13 @@ camel_session_get_storage_path (CamelSession *session, CamelService *service, if (access (path, F_OK) == 0) return path; - p = path + strlen (session->storage_path); - do { - p = strchr (p + 1, '/'); - if (p) - *p = '\0'; - if (access (path, F_OK) == -1) { - if (mkdir (path, S_IRWXU) == -1) { - camel_exception_setv (ex, - CAMEL_EXCEPTION_SYSTEM, - "Could not create " - "directory %s:\n%s", - path, - g_strerror (errno)); - g_free (path); - return NULL; - } - } - if (p) - *p = '/'; - } while (p); + if (e_mkdir_hier (path, S_IRWXU) == -1) { + camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, + "Could not create directory %s:\n%s", + path, g_strerror (errno)); + g_free (path); + return NULL; + } return path; } |