From d2193b45ff3098515115b317878814dc32098294 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 22 Sep 2021 09:44:44 +0000 Subject: examples/simpletest: check for libseat_dispatch failures --- examples/simpletest/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'examples/simpletest/main.c') diff --git a/examples/simpletest/main.c b/examples/simpletest/main.c index aeeace2..6f94cf5 100644 --- a/examples/simpletest/main.c +++ b/examples/simpletest/main.c @@ -43,7 +43,11 @@ int main(int argc, char *argv[]) { while (active == 0) { fprintf(stderr, "waiting for activation...\n"); - libseat_dispatch(backend, -1); + if (libseat_dispatch(backend, -1) == -1) { + libseat_close_seat(backend); + fprintf(stderr, "libseat_dispatch() failed: %s\n", strerror(errno)); + return -1; + } } fprintf(stderr, "active!\n"); -- cgit v1.2.3