summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index ba41a65..80a5c4d 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -133,10 +133,11 @@ int main(int /*argc*/, char ** /*argv*/) {
sigprocmask(SIG_BLOCK, &sset, nullptr);
p.add_fd(sfd.fd, [](int fd) {
struct signalfd_siginfo si;
- while (read(fd, &si, sizeof(si)) == sizeof(si)) {
+ if (read(fd, &si, sizeof(si)) == sizeof(si)) {
lognotice("Received signal %u", si.ssi_signo);
+ return -1;
}
- return -1;
+ return 0;
});
while ((d.flush(), p.check_events()) != -1) {