Merge pull request #95 from jvvv/master

Add break from main loop when X conn has error
This commit is contained in:
Giuseppe 2015-01-07 11:32:03 +01:00
commit c39c4e4d8b

4
bar.c
View File

@ -1119,6 +1119,10 @@ main (int argc, char **argv)
for (;;) { for (;;) {
bool redraw = false; bool redraw = false;
/* If connection is in error state, then it has been shut down. */
if (xcb_connection_has_error(c))
break;
if (poll(pollin, 2, -1) > 0) { if (poll(pollin, 2, -1) > 0) {
if (pollin[0].revents & POLLHUP) { /* No more data... */ if (pollin[0].revents & POLLHUP) { /* No more data... */
if (permanent) pollin[0].fd = -1; /* ...null the fd and continue polling :D */ if (permanent) pollin[0].fd = -1; /* ...null the fd and continue polling :D */