bar: signal abort (to main loop) when backend fails

This commit is contained in:
Daniel Eklöf 2019-09-22 11:59:34 +02:00
parent 4ce314e328
commit 5d6df44a79
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -7,6 +7,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <threads.h> #include <threads.h>
#include <assert.h> #include <assert.h>
#include <unistd.h>
#include <sys/eventfd.h> #include <sys/eventfd.h>
@ -238,6 +239,7 @@ run(struct bar *_bar)
if (!bar->backend.iface->setup(_bar)) { if (!bar->backend.iface->setup(_bar)) {
bar->backend.iface->cleanup(_bar); bar->backend.iface->cleanup(_bar);
write(_bar->abort_fd, &(uint64_t){1}, sizeof(uint64_t));
return 1; return 1;
} }