refactor(controller): Print error message on select fail
This commit is contained in:
parent
c30159abc6
commit
0fd614b0a9
@ -275,7 +275,20 @@ void controller::read_events() {
|
|||||||
int events = select(maxfd + 1, &readfds, nullptr, nullptr, nullptr);
|
int events = select(maxfd + 1, &readfds, nullptr, nullptr, nullptr);
|
||||||
|
|
||||||
// Check for errors
|
// Check for errors
|
||||||
if (events == -1 || g_terminate || m_connection.connection_has_error()) {
|
if (events == -1) {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The Interrupt errno is generated when polybar is stopped, so it
|
||||||
|
* shouldn't generate an error message
|
||||||
|
*/
|
||||||
|
if (errno != EINTR) {
|
||||||
|
m_log.err("select failed in event loop: %s", strerror(errno));
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (g_terminate || m_connection.connection_has_error()) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user