diff options
Diffstat (limited to 'nullshell.c')
-rw-r--r-- | nullshell.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/nullshell.c b/nullshell.c index 9218c18..b348d48 100644 --- a/nullshell.c +++ b/nullshell.c @@ -1,5 +1,5 @@ /* - * (C) 2013-2024 by Christian Hesse <mail@eworm.de> + * (C) 2013-2025 by Christian Hesse <mail@eworm.de> * * Based on ideas from Sleep Dummy Shell (SleepShell) * by Mario A. Valdez-Ramirez (http://www.mariovaldez.net/) @@ -54,8 +54,10 @@ int main(int argc, char **argv) { ssh_tty = getenv("SSH_TTY"); /* register signal callbacks */ - signal(SIGTERM, sig_callback); - signal(SIGINT, sig_callback); + struct sigaction act = { 0 }; + act.sa_handler = sig_callback; + sigaction(SIGINT, &act, NULL); + sigaction(SIGTERM, &act, NULL); /* clear the screen and set cursor to the top left * see 'man 4 console_codes' for details */ |