mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-22 20:25:39 +02:00
main: error handling
This commit is contained in:
parent
825c5c82b5
commit
10877d7c2e
1 changed files with 7 additions and 1 deletions
8
main.c
8
main.c
|
@ -65,13 +65,19 @@ main(int argc, const char *const *argv)
|
||||||
struct yml_node *conf = yml_load(conf_file);
|
struct yml_node *conf = yml_load(conf_file);
|
||||||
fclose(conf_file);
|
fclose(conf_file);
|
||||||
|
|
||||||
|
if (conf == NULL)
|
||||||
|
return 1;
|
||||||
|
|
||||||
xcb_init();
|
xcb_init();
|
||||||
|
|
||||||
const struct sigaction sa = {.sa_handler = &signal_handler};
|
const struct sigaction sa = {.sa_handler = &signal_handler};
|
||||||
sigaction(SIGINT, &sa, NULL);
|
sigaction(SIGINT, &sa, NULL);
|
||||||
|
|
||||||
int abort_fd = eventfd(0, EFD_CLOEXEC);
|
int abort_fd = eventfd(0, EFD_CLOEXEC);
|
||||||
assert(abort_fd >= 0);
|
if (abort_fd == -1) {
|
||||||
|
LOG_ERRNO("failed to create eventfd (for abort signalling)");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
struct bar *bar = conf_to_bar(yml_get_value(conf, "bar"));
|
struct bar *bar = conf_to_bar(yml_get_value(conf, "bar"));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue