Check initial wl_display_roundtrip() return value
On error, print a message and exit.
This commit is contained in:
parent
9b4b390588
commit
7b4a5c4447
5
main.c
5
main.c
@ -1208,7 +1208,10 @@ int main(int argc, char **argv) {
|
|||||||
|
|
||||||
struct wl_registry *registry = wl_display_get_registry(state.display);
|
struct wl_registry *registry = wl_display_get_registry(state.display);
|
||||||
wl_registry_add_listener(registry, ®istry_listener, &state);
|
wl_registry_add_listener(registry, ®istry_listener, &state);
|
||||||
wl_display_roundtrip(state.display);
|
if (wl_display_roundtrip(state.display) == -1) {
|
||||||
|
swaylock_log(LOG_ERROR, "wl_display_roundtrip() failed");
|
||||||
|
return EXIT_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
if (!state.compositor) {
|
if (!state.compositor) {
|
||||||
swaylock_log(LOG_ERROR, "Missing wl_compositor");
|
swaylock_log(LOG_ERROR, "Missing wl_compositor");
|
||||||
|
Loading…
Reference in New Issue
Block a user