Add break from main loop when X conn has error
This commit is contained in:
parent
5746d15cf8
commit
145c66b471
4
bar.c
4
bar.c
|
@ -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 */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user