Code Review
/
staging
/
windowmanager.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(parent:
d2ad02c
)
main: read only one signal and only return -1 if it succeeded
author
Marcus Fritzsch
<marcus_fritzsch@mentor.com>
Tue, 4 Jul 2017 14:29:05 +0000
(16:29 +0200)
committer
Marcus Fritzsch
<marcus_fritzsch@mentor.com>
Tue, 8 Aug 2017 15:24:00 +0000
(17:24 +0200)
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
src/main.cpp
patch
|
blob
|
history
diff --git
a/src/main.cpp
b/src/main.cpp
index
ba41a65
..
80a5c4d
100644
(file)
--- 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) {