aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2018-05-16 16:50:34 +0900
committerDominique Martinet <asmadeus@codewreck.org>2018-05-16 16:50:56 +0900
commit3b7cae0e31395d3515c75be1563be3de9373281a (patch)
tree1f0c68394b602bf4ca75a81dbc03b5867ae86d87
parent620b269418f79425168919f2215184dd0277272b (diff)
swayidle: terminate if wl_display_dispatch failed
-rw-r--r--swayidle/main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/swayidle/main.c b/swayidle/main.c
index 15f319c3..ad9c84c9 100644
--- a/swayidle/main.c
+++ b/swayidle/main.c
@@ -343,7 +343,10 @@ static int display_event(int fd, uint32_t mask, void *data) {
if (mask & WL_EVENT_HANGUP) {
sway_terminate(0);
}
- wl_display_dispatch(state.display);
+ if (wl_display_dispatch(state.display) < 0) {
+ wlr_log_errno(L_ERROR, "wl_display_dispatch failed, exiting");
+ sway_terminate(0);
+ };
return 0;
}