From 27e443ca6241d025358271f6fdad3513ac00d877 Mon Sep 17 00:00:00 2001 From: claudio Date: Wed, 24 Nov 2021 10:28:55 +0000 Subject: [PATCH] Minor code cleanup. Move a comment to the right place, move a function to get a better order of functions. Also reduce the size of sigprop to NSIG from NSIG+1. NSIG is defined as 33 and so includes the extra element for this array. OK mpi@ --- sys/kern/kern_sig.c | 29 ++++++++++++++++------------- sys/sys/signalvar.h | 4 +--- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 8ec7e4bd18f..2e950404096 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sig.c,v 1.288 2021/11/12 17:57:13 cheloha Exp $ */ +/* $OpenBSD: kern_sig.c,v 1.289 2021/11/24 10:28:55 claudio Exp $ */ /* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */ /* @@ -82,7 +82,10 @@ const struct filterops sig_filtops = { .f_event = filt_signal, }; -const int sigprop[NSIG + 1] = { +/* + * The array below categorizes the signals and their default actions. + */ +const int sigprop[NSIG] = { 0, /* unused */ SA_KILL, /* SIGHUP */ SA_KILL, /* SIGINT */ @@ -208,6 +211,17 @@ signal_init(void) PR_WAITOK, "sigapl", NULL); } +/* + * Initialize a new sigaltstack structure. + */ +void +sigstkinit(struct sigaltstack *ss) +{ + ss->ss_flags = SS_DISABLE; + ss->ss_size = 0; + ss->ss_sp = NULL; +} + /* * Create an initial sigacts structure, using the same signal state * as pr. @@ -222,17 +236,6 @@ sigactsinit(struct process *pr) return (ps); } -/* - * Initialize a new sigaltstack structure. - */ -void -sigstkinit(struct sigaltstack *ss) -{ - ss->ss_flags = SS_DISABLE; - ss->ss_size = 0; - ss->ss_sp = NULL; -} - /* * Release a sigacts structure. */ diff --git a/sys/sys/signalvar.h b/sys/sys/signalvar.h index 5157448210a..3f42de53b5b 100644 --- a/sys/sys/signalvar.h +++ b/sys/sys/signalvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: signalvar.h,v 1.50 2021/10/06 15:46:03 claudio Exp $ */ +/* $OpenBSD: signalvar.h,v 1.51 2021/11/24 10:28:55 claudio Exp $ */ /* $NetBSD: signalvar.h,v 1.17 1996/04/22 01:23:31 christos Exp $ */ /* @@ -73,8 +73,6 @@ struct sigacts { /* * Signal properties and actions. - * The array below categorizes the signals and their default actions - * according to the following properties: */ #define SA_KILL 0x01 /* terminates process by default */ #define SA_CORE 0x02 /* ditto and coredumps */ -- 2.20.1