From e3dc67a44da76451a5587694f52244331b358a9c Mon Sep 17 00:00:00 2001 From: sean Date: Tue, 19 Jun 2012 03:38:04 +0000 Subject: [PATCH] =?UTF-8?q?Added=20error=20handling=20code=20for=20the=20l?= =?UTF-8?q?oopret=20variable=20that=20was=20causing=20this=20warning"EchoS?= =?UTF-8?q?erver.cc:=20In=20member=20function=20=E2=80=98int=20EchoServer:?= =?UTF-8?q?:start()=E2=80=99:=20EchoServer.cc:1403:25:=20warning:=20variab?= =?UTF-8?q?le=20=E2=80=98loopret=E2=80=99=20set=20but=20not=20used=20[-Wun?= =?UTF-8?q?used-but-set-variable]",=20by=20simply=20mimicing=20the=20other?= =?UTF-8?q?=20error=20handling=20around=20nsock=5Floop=20elsewhere.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nping/EchoServer.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nping/EchoServer.cc b/nping/EchoServer.cc index ef8eb7d05..3d38b12d6 100644 --- a/nping/EchoServer.cc +++ b/nping/EchoServer.cc @@ -1492,6 +1492,11 @@ int EchoServer::start() { /* Sleep for a second until we check again for incoming connection requests */ nsock_timer_create(nsp, empty_handler, 1000, NULL); loopret=nsock_loop(nsp, 1000); + //If something went wrong in nsock_loop, let's just bail out. + if (loopret == NSOCK_LOOP_ERROR) { + outFatal(QT_3, "Unexpected nsock_loop error.\n"); + return OP_FAILURE; + } } return OP_SUCCESS; } /* End of start() */