From 8704ca42fe8b62f42383b9ee006f5846b47660e2 Mon Sep 17 00:00:00 2001 From: Alexander Courtis Date: Mon, 28 Oct 2024 10:10:43 +1100 Subject: [PATCH] fix(#17): log signals and exit code --- src/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 0584c6b..e0ca250 100644 --- a/src/main.c +++ b/src/main.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -82,7 +83,8 @@ int loop(void) { // signal received: int, quit, term struct signalfd_siginfo fdsi; if (read(pfd_signal->fd, &fdsi, sizeof(fdsi)) == sizeof(fdsi)) { - return fdsi.ssi_signo; + log_info("Received signal %d %s", fdsi.ssi_signo, strsignal(fdsi.ssi_signo)); + return EXIT_SUCCESS; } } else if (pfd_wayland->revents & pfd_wayland->events) { @@ -118,7 +120,7 @@ int main(int argc, char **argv) { rc = loop(); - log_info("wideriver done"); + log_info("wideriver done %d", rc); done: displ_destroy();