Skip to content

Commit

Permalink
fix(#17): log signals and exit code
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-courtis committed Oct 27, 2024
1 parent 27e735d commit 8704ca4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <signal.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <sys/signalfd.h>
#include <unistd.h>
#include <wayland-client-core.h>
Expand Down Expand Up @@ -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) {

Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 8704ca4

Please sign in to comment.