summaryrefslogtreecommitdiff
path: root/signal.c
diff options
context:
space:
mode:
authorToby Goodwin <toby@paccrat.org>2015-05-15 19:36:55 +0100
committerToby Goodwin <toby@paccrat.org>2015-05-16 21:23:24 +0100
commit27c900d6ae9cd0dcf4bc97bc9b8c1882e40ccfa8 (patch)
tree9ce71c54d395ebc0e84ecded69a75d2ed0ce831c /signal.c
parent3202133256713848312dddefba2250a6803bfec6 (diff)
snapshot from cvs: 2005-03-03
Diffstat (limited to 'signal.c')
-rw-r--r--signal.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/signal.c b/signal.c
index b5cbe63..037be1d 100644
--- a/signal.c
+++ b/signal.c
@@ -9,7 +9,7 @@
#include "jbwrap.h"
#if HAVE_SIGACTION
-static void (*sys_signal(int signum, void (*handler)(int)))(int) {
+void (*sys_signal(int signum, void (*handler)(int)))(int) {
struct sigaction new, old;
new.sa_handler = handler;
@@ -19,7 +19,9 @@ static void (*sys_signal(int signum, void (*handler)(int)))(int) {
return old.sa_handler;
}
#else
-#define sys_signal(sig, func) (signal((sig), (func)))
+void (*sys_signal(int signum, void (*handler)(int)))(int) {
+ return signal(signum, handler);
+}
#endif
void (*sighandlers[NUMOFSIGNALS])(int);
@@ -33,11 +35,6 @@ extern void catcher(int s) {
}
sys_signal(s, catcher);
-#if READLINE
- if (rl_active)
- siglongjmp(rl_buf.j, s);
-#endif /* READLINE */
-
#if HAVE_RESTARTABLE_SYSCALLS
if (slow) {
siglongjmp(slowbuf.j, s);
@@ -73,13 +70,11 @@ extern void (*rc_signal(int s, void (*h)(int)))(int) {
void (*old)(int);
sigchk();
old = sighandlers[s];
- if (h == SIG_DFL || h == SIG_IGN) {
- sighandlers[s] = h;
+ sighandlers[s] = h;
+ if (h == SIG_DFL || h == SIG_IGN)
sys_signal(s, h);
- } else {
- sighandlers[s] = h;
+ else
sys_signal(s, catcher);
- }
return old;
}