test init_gpio_mapping return value

Signed-off-by: Michel-FK <michel.stempin@funkey-project.com>
This commit is contained in:
Michel-FK 2021-04-26 08:10:06 +02:00
parent 921436805f
commit d9ff82b012

12
main.c
View File

@ -225,7 +225,17 @@ int main(int argc, char *argv[])
init_uinput();
/* Initialize the GPIO mapping */
init_gpio_mapping(config_file, &mapping_list);
if (init_gpio_mapping(config_file, &mapping_list) == false) {
/* Close the uinput device */
close_uinput();
if (daemon) {
/* Close the syslog */
closelog();
}
exit(EXIT_FAILURE);
}
while (true) {
/* Main loop to handle the GPIOs */