Reexecute on SIGUSR2
o9000 mrovi9000@gmail.com
1 files changed,
7 insertions(+),
0 deletions(-)
jump to
M
src/tint.c
→
src/tint.c
@@ -463,6 +463,7 @@ sigaction(SIGCHLD, &sa_chld, 0);
struct sigaction sa = {.sa_handler = signal_handler, .sa_flags = SA_RESTART}; sigaction(SIGUSR1, &sa, 0); + sigaction(SIGUSR2, &sa, 0); sigaction(SIGINT, &sa, 0); sigaction(SIGTERM, &sa, 0); sigaction(SIGHUP, &sa, 0);@@ -2177,6 +2178,12 @@ fprintf(stderr, YELLOW "%s %d: restarting tint2..." RESET "\n", __FILE__, __LINE__);
// restart tint2 // SIGUSR1 used when : user's signal, composite manager stop/start or xrandr goto start; + } else if (signal_pending == SIGUSR2) { + fprintf(stderr, YELLOW "%s %d: reexecuting tint2..." RESET "\n", __FILE__, __LINE__); + if (execvp(argv[0], argv) == -1) { + fprintf(stderr, RED "%s %d: failed!" RESET "\n", __FILE__, __LINE__); + return 1; + } } else { // SIGINT, SIGTERM, SIGHUP exit(0);