summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2014-05-14 21:14:35 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2014-05-14 21:14:35 +0200
commit95345a8913b41fa0c27bf1ba76d1b4f488345598 (patch)
tree53fa2e64320f0bc9b6b363b98ebd7752177ddafa
parent8a0848faf7fad8ec8e5482830ac5f28442e12b50 (diff)
downloaddabmux-95345a8913b41fa0c27bf1ba76d1b4f488345598.tar.gz
dabmux-95345a8913b41fa0c27bf1ba76d1b4f488345598.tar.bz2
dabmux-95345a8913b41fa0c27bf1ba76d1b4f488345598.zip
Correct error handling in StatsServer
-rw-r--r--src/StatsServer.cpp11
1 files changed, 4 insertions, 7 deletions
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);
}