summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-event
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsystemd/sd-event')
-rw-r--r--src/libsystemd/sd-event/sd-event.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c
index b56182dda7..4c67ee87e1 100644
--- a/src/libsystemd/sd-event/sd-event.c
+++ b/src/libsystemd/sd-event/sd-event.c
@@ -1973,20 +1973,22 @@ static int process_signal(sd_event *e, uint32_t events) {
for (;;) {
struct signalfd_siginfo si;
- ssize_t ss;
+ ssize_t n;
sd_event_source *s = NULL;
- ss = read(e->signal_fd, &si, sizeof(si));
- if (ss < 0) {
+ n = read(e->signal_fd, &si, sizeof(si));
+ if (n < 0) {
if (errno == EAGAIN || errno == EINTR)
return read_one;
return -errno;
}
- if (_unlikely_(ss != sizeof(si)))
+ if (_unlikely_(n != sizeof(si)))
return -EIO;
+ assert(si.ssi_signo < _NSIG);
+
read_one = true;
if (si.ssi_signo == SIGCHLD) {