* mu-msg-part.c, mu-runtime.c: updates for mu_util_create_dir_maybe change
This commit is contained in:
@ -232,7 +232,7 @@ mu_msg_part_filepath_cache (MuMsg *msg, guint partid)
|
||||
g_str_hash (path), G_DIR_SEPARATOR,
|
||||
partid);
|
||||
|
||||
if (!mu_util_create_dir_maybe (dirname, 0700)) {
|
||||
if (!mu_util_create_dir_maybe (dirname, 0700, FALSE)) {
|
||||
g_free (dirname);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -55,18 +55,6 @@ static gboolean init_paths (const char* muhome, MuRuntimeData *data);
|
||||
static const char* runtime_path (MuRuntimePath path);
|
||||
|
||||
|
||||
static gboolean
|
||||
mu_dir_is_readable_and_writable (const char *muhome)
|
||||
{
|
||||
if (mu_util_create_dir_maybe (muhome, 0700))
|
||||
return TRUE;
|
||||
|
||||
g_warning ("cannot use '%s' as a mu homedir", muhome);
|
||||
g_warning ("use --muhome= to set a different one");
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
init_log (const char *muhome, const char *name,
|
||||
gboolean log_stderr, gboolean quiet, gboolean debug)
|
||||
@ -107,7 +95,9 @@ mu_runtime_init (const char* muhome_arg, const char *name)
|
||||
else
|
||||
muhome = mu_util_guess_mu_homedir ();
|
||||
|
||||
if (!mu_dir_is_readable_and_writable (muhome)) {
|
||||
if (!mu_util_create_dir_maybe (muhome, 0700, TRUE)) {
|
||||
g_printerr ("mu: invalid mu homedir specified;"
|
||||
" use --muhome=<dir>\n");
|
||||
runtime_free ();
|
||||
return FALSE;
|
||||
}
|
||||
@ -143,8 +133,10 @@ mu_runtime_init_from_cmdline (int *pargc, char ***pargv, const char *name)
|
||||
runtime_free ();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!mu_dir_is_readable_and_writable (_data->_config->muhome)) {
|
||||
|
||||
if (!mu_util_create_dir_maybe (_data->_config->muhome, 0700, TRUE)) {
|
||||
g_printerr ("mu: invalid mu homedir specified;"
|
||||
" use --muhome=<dir>\n");
|
||||
runtime_free ();
|
||||
return FALSE;
|
||||
}
|
||||
@ -198,13 +190,13 @@ static gboolean
|
||||
create_dirs_maybe (MuRuntimeData *data)
|
||||
{
|
||||
if (!mu_util_create_dir_maybe
|
||||
(data->_str[MU_RUNTIME_PATH_CACHE], 0700)) {
|
||||
(data->_str[MU_RUNTIME_PATH_CACHE], 0700, TRUE)) {
|
||||
g_warning ("failed to create cache dir");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!mu_util_create_dir_maybe
|
||||
(data->_str[MU_RUNTIME_PATH_LOG], 0700)) {
|
||||
(data->_str[MU_RUNTIME_PATH_LOG], 0700, TRUE)) {
|
||||
g_warning ("failed to create log dir");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user