aboutsummaryrefslogtreecommitdiffstats
path: root/etc.c
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2002-01-21 17:57:27 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2002-01-21 17:57:27 +0000
commitaae61245cf97484f0fa7758af342d29ad123b3e7 (patch)
tree41002f49445458b5b00a40a57dceed8c260d44ca /etc.c
parenturl.c (URI_PATTERN): remove \ (diff)
downloadw3m-aae61245cf97484f0fa7758af342d29ad123b3e7.tar.gz
w3m-aae61245cf97484f0fa7758af342d29ad123b3e7.zip
[w3m-dev 02879] reset signals
* etc.c (reset_signals): added * etc.c (mySystem): use reset_signals() * file.c (uncompress_stream): use reset_signals() * proto.h (reset_signals): added * search.c (init_migemo): kill by SIGKILL * search.c (open_migemo): use reset_signals() From: Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
Diffstat (limited to 'etc.c')
-rw-r--r--etc.c31
1 files changed, 27 insertions, 4 deletions
diff --git a/etc.c b/etc.c
index 6350fab..8637807 100644
--- a/etc.c
+++ b/etc.c
@@ -1,4 +1,4 @@
-/* $Id: etc.c,v 1.16 2001/12/26 18:29:33 ukai Exp $ */
+/* $Id: etc.c,v 1.17 2002/01/21 17:57:27 ukai Exp $ */
#include "fm.h"
#include <pwd.h>
#include "myctype.h"
@@ -1031,6 +1031,31 @@ romanAlphabet(int n)
return r;
}
+#ifndef SIGIOT
+#define SIGIOT SIGABRT
+#endif /* not SIGIOT */
+
+void
+reset_signals(void)
+{
+ signal(SIGHUP, SIG_DFL); /* terminate process */
+ signal(SIGINT, SIG_DFL); /* terminate process */
+ signal(SIGQUIT, SIG_DFL); /* terminate process */
+ signal(SIGTERM, SIG_DFL); /* terminate process */
+ signal(SIGILL, SIG_DFL); /* create core image */
+ signal(SIGIOT, SIG_DFL); /* create core image */
+ signal(SIGFPE, SIG_DFL); /* create core image */
+#ifdef SIGBUS
+ signal(SIGBUS, SIG_DFL); /* create core image */
+#endif /* SIGBUS */
+#ifdef SIGCHLD
+ signal(SIGCHLD, SIG_IGN);
+#endif
+#ifdef SIGPIPE
+ signal(SIGPIPE, SIG_IGN);
+#endif
+}
+
void
mySystem(char *command, int background)
{
@@ -1043,9 +1068,7 @@ mySystem(char *command, int background)
int pid;
flush_tty();
if ((pid = fork()) == 0) {
-#ifdef SIGCHLD
- signal(SIGCHLD, SIG_IGN);
-#endif
+ reset_signals();
setpgrp();
close_tty();
fclose(stdout);