From: Aki Tuomi Date: Tue, 9 Jul 2013 07:29:25 +0000 (+0300) Subject: Fixed incorrect use or errno X-Git-Tag: rec-3.6.0-rc1~579^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fa947deae1639573762763fe2e94f616ed58655b;p=pdns Fixed incorrect use or errno --- diff --git a/modules/remotebackend/unixconnector.cc b/modules/remotebackend/unixconnector.cc index 801ed275e..4894dd317 100644 --- a/modules/remotebackend/unixconnector.cc +++ b/modules/remotebackend/unixconnector.cc @@ -120,6 +120,7 @@ void UnixsocketConnector::reconnect() { struct sockaddr_un sock; rapidjson::Document init,res; rapidjson::Value val; + int rv; if (connected) return; // no point reconnecting if connected... connected = true; @@ -136,11 +137,11 @@ void UnixsocketConnector::reconnect() { path.copy(sock.sun_path, UNIX_PATH_MAX, 0); fcntl(fd, F_SETFL, O_NONBLOCK, &fd); - while(connect(fd, reinterpret_cast(&sock), sizeof sock)==-1 && (errno == EINPROGRESS)) { + while((rv = connect(fd, reinterpret_cast(&sock), sizeof sock))==-1 && (errno == EINPROGRESS)) { waitForData(fd, 0, 500); } - if (errno != EISCONN && errno != 0) { + if (rv != 0 && errno != EISCONN && errno != 0) { L<