aboutsummaryrefslogtreecommitdiff
path: root/swaynag
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2020-03-29 10:09:29 +0200
committerSimon Ser <contact@emersion.fr>2020-04-02 23:27:57 +0200
commit284dcb2dc747f783f767121fe01fa7202da30e4e (patch)
treed507142166c81df21289de3e2ae524da9c51b731 /swaynag
parentac3444295d0f045633ed3bbb154633fe0228c722 (diff)
swaynag: exit on wl_display_roundtrip error
fixes loop when sway closes the socket in the middle of querying outputs, see #5138.
Diffstat (limited to 'swaynag')
-rw-r--r--swaynag/swaynag.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/swaynag/swaynag.c b/swaynag/swaynag.c
index 06700e47..4e692b14 100644
--- a/swaynag/swaynag.c
+++ b/swaynag/swaynag.c
@@ -444,7 +444,11 @@ void swaynag_setup(struct swaynag *swaynag) {
assert(swaynag->compositor && swaynag->layer_shell && swaynag->shm);
while (swaynag->querying_outputs > 0) {
- wl_display_roundtrip(swaynag->display);
+ if (wl_display_roundtrip(swaynag->display) < 0) {
+ sway_log(SWAY_ERROR, "Error during outputs init.");
+ swaynag_destroy(swaynag);
+ exit(EXIT_FAILURE);
+ }
}
if (!swaynag->output && swaynag->type->output) {