diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2021-11-24 10:28:56 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2021-11-24 10:28:56 +0000 |
commit | 0502a512b28c28bcba28e2b978262469807da1fd (patch) | |
tree | 27ff84b2f459bcd05d81e9390fc5d69be750ae34 | |
parent | 56b052090c4c910fd718a461775a5bfc5847b17a (diff) |
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@
-rw-r--r-- | sys/kern/kern_sig.c | 29 | ||||
-rw-r--r-- | 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 */ @@ -209,6 +212,17 @@ signal_init(void) } /* + * 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. */ @@ -223,17 +237,6 @@ sigactsinit(struct process *pr) } /* - * 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. */ void 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 */ |