diff --git a/auditd-plugin-clickhouse.cpp b/auditd-plugin-clickhouse.cpp index ff3434a..7cc0bac 100644 --- a/auditd-plugin-clickhouse.cpp +++ b/auditd-plugin-clickhouse.cpp @@ -462,10 +462,13 @@ void writer_thread_function(clickhouse::Client &client, const std::string &table if (res < 0) { - // error occured, finish running - Logger::write("Poll returned error: %d\n", errno); - stop_running(); - thread_keep_running = false; + if (errno != EINTR) + { + // error occured, finish running + Logger::write("Poll returned error: %d\n", errno); + stop_running(); + thread_keep_running = false; + } } else if (res == 0) { @@ -480,7 +483,7 @@ void writer_thread_function(clickhouse::Client &client, const std::string &table else if ((pollfds[0].revents & POLLHUP) || (pollfds[0].revents & POLLERR)) { // pipe closed too early, an error - Logger::write("Read returned error: %d\n", errno); + Logger::write("Read returned pollhup or pollerr\n"); stop_running(); thread_keep_running = false; } @@ -498,7 +501,7 @@ void writer_thread_function(clickhouse::Client &client, const std::string &table else if ((pollfds[1].revents & POLLHUP) || (pollfds[1].revents & POLLERR)) { // pipe closed too early, an error - Logger::write("Read returned error: %d\n", errno); + Logger::write("Read returned pollhup or pollerr\n"); stop_running(); thread_keep_running = false; } @@ -981,9 +984,12 @@ int main(int argc, char **argv) int res = poll(pollfds, sizeof(pollfds) / sizeof(pollfds[0]), -1); if (res < 0) { - // error occured, finish running - Logger::write("Poll returned error: %d\n", errno); - running = false; + if (errno != EINTR) + { + // error occured, finish running + Logger::write("Poll returned error: %d\n", errno); + running = false; + } } else if (res == 0) {