diff options
author | Simon Ser <contact@emersion.fr> | 2021-09-22 09:44:44 +0000 |
---|---|---|
committer | Kenny Levinsen <kl@kl.wtf> | 2021-09-22 21:59:41 +0200 |
commit | d2193b45ff3098515115b317878814dc32098294 (patch) | |
tree | dd44ddcd60464a2dded4ee2f87395ac8f42984cf /examples/simpletest | |
parent | 262ccef84eddf3714183b80729a157504615468e (diff) |
examples/simpletest: check for libseat_dispatch failures
Diffstat (limited to 'examples/simpletest')
-rw-r--r-- | examples/simpletest/main.c | 6 |
1 files changed, 5 insertions, 1 deletions
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"); |