From: Aki Tuomi Date: Tue, 9 Jul 2013 07:00:00 +0000 (+0300) Subject: Fixed coverity issues X-Git-Tag: rec-3.6.0-rc1~579^2~3^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3172fd4bbb7c5c51cf2e429e1ec94c2a61651be1;p=thirdparty%2Fpdns.git Fixed coverity issues --- diff --git a/modules/remotebackend/unixconnector.cc b/modules/remotebackend/unixconnector.cc index 801ed275e1..ff7080d07c 100644 --- a/modules/remotebackend/unixconnector.cc +++ b/modules/remotebackend/unixconnector.cc @@ -19,6 +19,7 @@ UnixsocketConnector::UnixsocketConnector(std::map optio this->path = options.find("path")->second; this->options = options; this->connected = false; + this->fd = -1; } UnixsocketConnector::~UnixsocketConnector() { @@ -134,7 +135,12 @@ void UnixsocketConnector::reconnect() { sock.sun_family = AF_UNIX; memset(sock.sun_path, 0, UNIX_PATH_MAX); path.copy(sock.sun_path, UNIX_PATH_MAX, 0); - fcntl(fd, F_SETFL, O_NONBLOCK, &fd); + if (fcntl(fd, F_SETFL, O_NONBLOCK, &fd)) { + connected = false; + L<(&sock), sizeof sock)==-1 && (errno == EINPROGRESS)) { waitForData(fd, 0, 500);