examples/simpletest: check for libseat_dispatch failures

This commit is contained in:
Simon Ser 2021-09-22 09:44:44 +00:00 committed by Kenny Levinsen
parent 262ccef84e
commit d2193b45ff

View file

@ -43,7 +43,11 @@ int main(int argc, char *argv[]) {
while (active == 0) { while (active == 0) {
fprintf(stderr, "waiting for activation...\n"); 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"); fprintf(stderr, "active!\n");