diff options
author | Tobias Weingartner <weingart@cvs.openbsd.org> | 2002-01-31 02:12:19 +0000 |
---|---|---|
committer | Tobias Weingartner <weingart@cvs.openbsd.org> | 2002-01-31 02:12:19 +0000 |
commit | 7edc4966926d30692f486506c6b4e7c6285dc080 (patch) | |
tree | d493ad8958920c85bbcc12ce45cd8710ab09ce4b /sys | |
parent | e17ab071078e872be4637204432596d09b19e98e (diff) |
Ignore signals if/when we are exiting.
Prevents a hang in the NFS code when
dumping core and pressing ^C, etc.
ok art@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_sig.c | 9 | ||||
-rw-r--r-- | sys/sys/proc.h | 3 |
2 files changed, 10 insertions, 2 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 6d1c0be45ef..989ba8c085f 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sig.c,v 1.53 2002/01/23 00:39:47 art Exp $ */ +/* $OpenBSD: kern_sig.c,v 1.54 2002/01/31 02:12:18 weingart Exp $ */ /* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */ /* @@ -770,6 +770,10 @@ psignal(p, signum) KNOTE(&p->p_klist, NOTE_SIGNAL | signum); + /* Ignore signal if we are exiting */ + if (p->p_flag & P_WEXIT) + return; + mask = sigmask(signum); prop = sigprop[signum]; @@ -1230,6 +1234,9 @@ sigexit(p, signum) int signum; { + /* Mark process as going away */ + p->p_flag |= P_WEXIT; + p->p_acflag |= AXSIG; if (sigprop[signum] & SA_CORE) { p->p_sigacts->ps_sig = signum; diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 00fccb5b671..8e20f05f1bd 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: proc.h,v 1.54 2002/01/25 15:00:26 art Exp $ */ +/* $OpenBSD: proc.h,v 1.55 2002/01/31 02:12:18 weingart Exp $ */ /* $NetBSD: proc.h,v 1.44 1996/04/22 01:23:21 christos Exp $ */ /*- @@ -233,6 +233,7 @@ struct proc { #define P_TIMEOUT 0x000400 /* Timing out during sleep. */ #define P_TRACED 0x000800 /* Debugged process being traced. */ #define P_WAITED 0x001000 /* Debugging proc has waited for child. */ +/* XXX - Should be merged with INEXEC */ #define P_WEXIT 0x002000 /* Working on exiting. */ #define P_EXEC 0x004000 /* Process called exec. */ |