2 * UCW Library -- Catching of signals and calling callback functions
4 * (c) 2004, Robert Spalek <robert@ucw.cz>
13 sh_sighandler_t signal_handler[_NSIG];
16 signal_handler_internal(int sig)
18 if (signal_handler[sig])
20 if (!signal_handler[sig](sig))
27 handle_signal(int signum, struct sigaction *oldact)
30 bzero(&act, sizeof(act));
31 act.sa_handler = signal_handler_internal;
32 act.sa_flags = SA_NOMASK;
33 if (sigaction(signum, &act, oldact) < 0)
38 unhandle_signal(int signum, struct sigaction *oldact)
40 if (sigaction(signum, oldact, NULL) < 0)