summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-event
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-04-08 11:27:28 +0200
committerLennart Poettering <lennart@poettering.net>2016-04-12 13:43:32 +0200
commit6eb7c172b58d81a5f6c3998ce304a7324fc65050 (patch)
treea720b0f860bc65bfc09cbbafe869b2974d7d0c16 /src/libsystemd/sd-event
parent4c310c073aec5a31a7e626ea8ceb86d3a28291aa (diff)
tree-wide: add new SIGNAL_VALID() macro-like function that validates signal numbers
And port all code over to use it.
Diffstat (limited to 'src/libsystemd/sd-event')
-rw-r--r--src/libsystemd/sd-event/sd-event.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c
index 841358ed03..9fd744768d 100644
--- a/src/libsystemd/sd-event/sd-event.c
+++ b/src/libsystemd/sd-event/sd-event.c
@@ -1145,8 +1145,7 @@ _public_ int sd_event_add_signal(
int r;
assert_return(e, -EINVAL);
- assert_return(sig > 0, -EINVAL);
- assert_return(sig < _NSIG, -EINVAL);
+ assert_return(SIGNAL_VALID(sig), -EINVAL);
assert_return(e->state != SD_EVENT_FINISHED, -ESTALE);
assert_return(!event_pid_changed(e), -ECHILD);
@@ -2200,7 +2199,7 @@ static int process_signal(sd_event *e, struct signal_data *d, uint32_t events) {
if (_unlikely_(n != sizeof(si)))
return -EIO;
- assert(si.ssi_signo < _NSIG);
+ assert(SIGNAL_VALID(si.ssi_signo));
read_one = true;