mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-29 10:36:00 +01:00
Print error message if directory creation failed
This commit is contained in:
parent
f82845a0cb
commit
ac88923e5b
1 changed files with 8 additions and 2 deletions
10
zathura.c
10
zathura.c
|
@ -3,6 +3,7 @@
|
|||
#define _BSD_SOURCE
|
||||
#define _XOPEN_SOURCE 700
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <math.h>
|
||||
|
@ -95,8 +96,13 @@ zathura_init(zathura_t* zathura)
|
|||
}
|
||||
|
||||
/* create zathura (config/data) directory */
|
||||
g_mkdir_with_parents(zathura->config.config_dir, 0771);
|
||||
g_mkdir_with_parents(zathura->config.data_dir, 0771);
|
||||
if (g_mkdir_with_parents(zathura->config.config_dir, 0771) == -1) {
|
||||
girara_error("Could not create '%s': %s", zathura->config.config_dir, strerror(errno));
|
||||
}
|
||||
|
||||
if (g_mkdir_with_parents(zathura->config.data_dir, 0771) == -1) {
|
||||
girara_error("Could not create '%s': %s", zathura->config.data_dir, strerror(errno));
|
||||
}
|
||||
|
||||
/* load plugins */
|
||||
zathura_plugin_manager_load(zathura->plugins.manager);
|
||||
|
|
Loading…
Reference in a new issue