X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fio%2Fsg_netChannel.cxx;h=817650ac482b04c5da9b835d3809e15530f65e8d;hb=adb7db9229db1d869b254ac18f1471bed464c508;hp=b903a98082f4c31d6f853c168140c1d98f985dfa;hpb=31ed79fe4311a4950a1574f7a6d42af434e072c6;p=simgear.git diff --git a/simgear/io/sg_netChannel.cxx b/simgear/io/sg_netChannel.cxx index b903a980..817650ac 100644 --- a/simgear/io/sg_netChannel.cxx +++ b/simgear/io/sg_netChannel.cxx @@ -211,7 +211,7 @@ NetChannel::handleResolve() if (!addr.isValid()) { SG_LOG(SG_IO, SG_WARN, "Network: host lookup failed:" << host); - handleError (0); + handleError (ENOENT); close(); return -1; } @@ -327,8 +327,13 @@ void NetChannel::handleAccept (void) { SG_LOG(SG_IO, SG_WARN, "Network:" << getHandle() << ": unhandled accept"); } -void NetChannel::handleError (int error) { - SG_LOG(SG_IO, SG_WARN,"Network:" << getHandle() << ": errno: " << strerror(errno) <<"(" << errno << ")"); +void NetChannel::handleError (int error) +{ + // warn about address lookup failures seperately, don't warn again. + // (and we (ab-)use ENOENT to mean 'name not found'. + if (error != ENOENT) { + SG_LOG(SG_IO, SG_WARN,"Network:" << getHandle() << ": errno: " << strerror(errno) <<"(" << errno << ")"); + } } } // of namespace simgear