diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-01-21 17:57:27 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-01-21 17:57:27 +0000 |
commit | aae61245cf97484f0fa7758af342d29ad123b3e7 (patch) | |
tree | 41002f49445458b5b00a40a57dceed8c260d44ca | |
parent | url.c (URI_PATTERN): remove \ (diff) | |
download | w3m-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>
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | etc.c | 31 | ||||
-rw-r--r-- | file.c | 4 | ||||
-rw-r--r-- | proto.h | 3 | ||||
-rw-r--r-- | search.c | 9 |
5 files changed, 45 insertions, 14 deletions
@@ -1,3 +1,13 @@ +2002-01-22 Hironori Sakamoto <hsaka@mth.biglobe.ne.jp> + + * [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() + 2002-01-22 Fumitoshi UKAI <ukai@debian.or.jp> * url.c (URI_PATTERN): remove \ @@ -2174,4 +2184,4 @@ * release-0-2-1 * import w3m-0.2.1 -$Id: ChangeLog,v 1.247 2002/01/21 16:58:32 ukai Exp $ +$Id: ChangeLog,v 1.248 2002/01/21 17:57:27 ukai Exp $ @@ -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); @@ -1,4 +1,4 @@ -/* $Id: file.c,v 1.44 2002/01/15 03:45:02 ukai Exp $ */ +/* $Id: file.c,v 1.45 2002/01/21 17:57:28 ukai Exp $ */ #include "fm.h" #include <sys/types.h> #include "myctype.h" @@ -6149,7 +6149,7 @@ uncompress_stream(URLFile *uf) flush_tty(); /* fd1[0]: read, fd1[1]: write */ if ((pid1 = fork()) == 0) { - signal(SIGINT, SIG_DFL); + reset_signals(); close(fd1[0]); if (tmpf) { #ifdef USE_BINMODE_STREAM @@ -1,4 +1,4 @@ -/* $Id: proto.h,v 1.27 2002/01/17 11:06:45 ukai Exp $ */ +/* $Id: proto.h,v 1.28 2002/01/21 17:57:28 ukai Exp $ */ /* * This file was automatically generated by version 1.7 of cextract. * Manual editing not recommended. @@ -485,6 +485,7 @@ extern void add_auth_cookie(char *host, int port, char *realm, Str cookie); extern char *last_modified(Buffer *buf); extern Str romanNumeral(int n); extern Str romanAlphabet(int n); +extern void reset_signals(void); extern void mySystem(char *command, int background); extern Str myExtCommand(char *cmd, char *arg, int redirect); extern Str myEditor(char *cmd, char *file, int line); @@ -1,4 +1,4 @@ -/* $Id: search.c,v 1.16 2002/01/17 15:49:04 ukai Exp $ */ +/* $Id: search.c,v 1.17 2002/01/21 17:57:28 ukai Exp $ */ #include "fm.h" #include "regex.h" #include <signal.h> @@ -28,7 +28,7 @@ init_migemo() fclose(migemow); migemor = migemow = NULL; if (migemo_pid) - kill(migemo_pid, SIGTERM); + kill(migemo_pid, SIGKILL); migemo_pid = 0; } @@ -50,10 +50,7 @@ open_migemo(char *migemo_command) goto err2; if (migemo_pid == 0) { /* child */ - signal(SIGINT, SIG_IGN); -#ifdef SIGCHLD - signal(SIGCHLD, SIG_IGN); -#endif + reset_signals(); #ifdef HAVE_SETPGRP setpgrp(); #endif |