refactor(controller): Print error message on select fail

This commit is contained in:
patrick96 2018-02-13 10:15:02 +01:00 committed by NBonaparte
parent c30159abc6
commit 0fd614b0a9
1 changed files with 14 additions and 1 deletions

View File

@ -275,7 +275,20 @@ void controller::read_events() {
int events = select(maxfd + 1, &readfds, nullptr, nullptr, nullptr);
// 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;
}