- u.u_error = 0;
- /*
- * Set the new mask value and also defer further
- * occurences of this signal.
- *
- * Special case: user has done a sigpause. Here the
- * current mask is not of interest, but rather the
- * mask from before the sigpause is what we want
- * restored after the signal processing is completed.
- */
- (void) splhigh();
- if (p->p_flag & SOMASK) {
- returnmask = u.u_oldmask;
- p->p_flag &= ~SOMASK;
- } else
- returnmask = p->p_sigmask;
- p->p_sigmask |= u.u_sigmask[sig] | mask;
- (void) spl0();
- u.u_ru.ru_nsignals++;
- sendsig(action, sig, returnmask, 0);
- continue;
- }
- u.u_acflag |= AXSIG;
- switch (sig) {
-
- case SIGILL:
- case SIGIOT:
- case SIGBUS:
- case SIGQUIT:
- case SIGTRAP:
- case SIGEMT:
- case SIGFPE:
- case SIGSEGV:
- case SIGSYS:
- u.u_arg[0] = sig;
- if (core() == 0)
- sig |= WCOREFLAG;
- }
- exit(W_EXITCODE(0, sig));
- /* NOTREACHED */
- } while (sig = CURSIG(p));
+ /*
+ * Set the new mask value and also defer further
+ * occurences of this signal.
+ *
+ * Special case: user has done a sigpause. Here the
+ * current mask is not of interest, but rather the
+ * mask from before the sigpause is what we want
+ * restored after the signal processing is completed.
+ */
+ (void) splhigh();
+ if (ps->ps_flags & SA_OLDMASK) {
+ returnmask = ps->ps_oldmask;
+ ps->ps_flags &= ~SA_OLDMASK;
+ } else
+ returnmask = p->p_sigmask;
+ p->p_sigmask |= ps->ps_catchmask[sig] | mask;
+ (void) spl0();
+ p->p_stats->p_ru.ru_nsignals++;
+ sendsig(action, sig, returnmask, 0);
+ }
+}
+
+/*
+ * Force the current process to exit with the specified
+ * signal, dumping core if appropriate. We bypass the normal
+ * tests for masked and caught signals, allowing unrecoverable
+ * failures to terminate the process without changing signal state.
+ * Mark the accounting record with the signal termination.
+ * If dumping core, save the signal number for the debugger.
+ * Calls exit and does not return.
+ */
+sigexit(p, sig)
+ register struct proc *p;
+ int sig;
+{
+
+ p->p_acflag |= AXSIG;
+ if (sigprop[sig] & SA_CORE) {
+ p->p_sigacts->ps_sig = sig;
+ if (coredump(p) == 0)
+ sig |= WCOREFLAG;
+ }
+ exit(p, W_EXITCODE(0, sig));
+ /* NOTREACHED */