From 8c9a2b21f91901b1b0f8882124c52d642d850499 Mon Sep 17 00:00:00 2001 From: Arnaud Ferraris Date: Sun, 13 Dec 2020 00:35:17 +0100 Subject: [PATCH] gpio: exit if we can't request output GPIOs This means the system is in a very bad shape as no other software should make use of those, so exit the daemon (will be restarted by systemd). --- src/gpio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gpio.c b/src/gpio.c index 53d87d6..e91bb5c 100644 --- a/src/gpio.c +++ b/src/gpio.c @@ -131,13 +131,13 @@ int gpio_init(struct EG25Manager *manager) manager->gpio_out[i] = gpiod_chip_get_line(manager->gpiochip[chipidx], offset); if (!manager->gpio_out[i]) { - g_critical("Unable to get output GPIO %d", i); + g_error("Unable to get output GPIO %d", i); return 1; } ret = gpiod_line_request_output(manager->gpio_out[i], "eg25manager", 0); if (ret < 0) { - g_critical("Unable to request output GPIO %d", i); + g_error("Unable to request output GPIO %d", i); return 1; } }