From 95345a8913b41fa0c27bf1ba76d1b4f488345598 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Wed, 14 May 2014 21:14:35 +0200 Subject: Correct error handling in StatsServer --- src/StatsServer.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/StatsServer.cpp b/src/StatsServer.cpp index 38c4607..676c832 100644 --- a/src/StatsServer.cpp +++ b/src/StatsServer.cpp @@ -299,16 +299,13 @@ void StatsServer::serverThread() else { int len = snprintf(buffer, 256, "Invalid command\n"); - n = write(accepted_sock, buffer, len); - if (n < 0) { - etiLog.level(warn) << "Error writing to Stats Server socket " << - strerror(errno); - } - close(accepted_sock); - continue; } + if (n < 0) { + etiLog.level(warn) << "Error writing to Stats Server socket " << + strerror(errno); + } close(accepted_sock); } -- cgit v1.2.3