From: Davin McCall Date: Tue, 21 Jun 2016 15:11:10 +0000 (+0100) Subject: Log some error conditions (kill some TODOs) X-Git-Tag: v0.04~23 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=89288989b4d7b7566a92675164fe2e04220de2b4;p=oweals%2Fdinit.git Log some error conditions (kill some TODOs) --- diff --git a/src/control.cc b/src/control.cc index a887d27..4e0c72a 100644 --- a/src/control.cc +++ b/src/control.cc @@ -278,7 +278,7 @@ bool ControlConn::queuePacket(const char *pkt, unsigned size) noexcept return false; } if (errno != EAGAIN && errno != EWOULDBLOCK && errno != EINTR) { - // TODO log error + log(LogLevel::WARN, "Error writing to control connection: ", strerror(errno)); return false; } // EAGAIN etc: fall through to below @@ -333,7 +333,7 @@ bool ControlConn::queuePacket(std::vector &&pkt) noexcept return false; } if (errno != EAGAIN && errno != EWOULDBLOCK && errno != EINTR) { - // TODO log error + log(LogLevel::WARN, "Error writing to control connection: ", strerror(errno)); return false; } // EAGAIN etc: fall through to below @@ -385,7 +385,7 @@ bool ControlConn::dataReady() noexcept // Note file descriptor is non-blocking if (r == -1) { if (errno != EAGAIN && errno != EWOULDBLOCK && errno != EINTR) { - // TODO log error + log(LogLevel::WARN, "Error writing to control connection: ", strerror(errno)); return true; } return false; @@ -407,8 +407,7 @@ bool ControlConn::dataReady() noexcept } else if (rbuf.get_length() == 1024) { // Too big packet - // TODO log error? - // TODO error response? + log(LogLevel::WARN, "Received too-large control package; dropping connection"); bad_conn_close = true; iob.setWatches(OUT_EVENTS); }