Only create data directory if not available

This commit is contained in:
Sebastian Ramacher 2020-06-16 23:41:28 +02:00
parent edea6a5403
commit 931fd9f6cf

View File

@ -131,11 +131,6 @@ create_directories(zathura_t* zathura)
{ {
static const unsigned int mode = 0700; static const unsigned int mode = 0700;
if (g_mkdir_with_parents(zathura->config.config_dir, mode) == -1) {
girara_error("Could not create '%s': %s", zathura->config.config_dir,
strerror(errno));
}
if (g_mkdir_with_parents(zathura->config.data_dir, mode) == -1) { if (g_mkdir_with_parents(zathura->config.data_dir, mode) == -1) {
girara_error("Could not create '%s': %s", zathura->config.data_dir, girara_error("Could not create '%s': %s", zathura->config.data_dir,
strerror(errno)); strerror(errno));
@ -424,7 +419,7 @@ zathura_init(zathura_t* zathura)
/* Set application ID */ /* Set application ID */
g_set_prgname("org.pwmt.zathura"); g_set_prgname("org.pwmt.zathura");
/* create zathura (config/data) directory */ /* create zathura data directory */
create_directories(zathura); create_directories(zathura);
/* load plugins */ /* load plugins */
@ -467,7 +462,6 @@ zathura_init(zathura_t* zathura)
/* disable unsupported features in strict sandbox mode */ /* disable unsupported features in strict sandbox mode */
if (zathura->global.sandbox != ZATHURA_SANDBOX_STRICT){ if (zathura->global.sandbox != ZATHURA_SANDBOX_STRICT){
/* database */ /* database */
init_database(zathura); init_database(zathura);
} }