forked from external/yambar
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);
|
||||
fclose(conf_file);
|
||||
|
||||
if (conf == NULL)
|
||||
return 1;
|
||||
|
||||
xcb_init();
|
||||
|
||||
const struct sigaction sa = {.sa_handler = &signal_handler};
|
||||
sigaction(SIGINT, &sa, NULL);
|
||||
|
||||
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"));
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue