w3m

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/w3m.git/
Log | Files | Refs | README

commit 5efa791151f4abb1fc00ec8791b0f9df906ac6ee
parent 6f67861f34ef1fb6174b562c42a84cf68d474962
Author: ukai <ukai>
Date:   Mon, 21 Jan 2002 17:57:27 +0000

[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:
MChangeLog | 10++++++++++
Metc.c | 29++++++++++++++++++++++++++---
Mfile.c | 2+-
Mproto.h | 1+
Msearch.c | 7++-----
5 files changed, 40 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -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 \ diff --git a/etc.c b/etc.c @@ -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); diff --git a/file.c b/file.c @@ -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 diff --git a/proto.h b/proto.h @@ -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); diff --git a/search.c b/search.c @@ -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