Skip to content

Instantly share code, notes, and snippets.

@Habbie
Created April 26, 2013 11:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Habbie/5466876 to your computer and use it in GitHub Desktop.
Save Habbie/5466876 to your computer and use it in GitHub Desktop.
Index: modules/remotebackend/httpconnector.cc
===================================================================
--- modules/remotebackend/httpconnector.cc (revision 3115)
+++ modules/remotebackend/httpconnector.cc (working copy)
@@ -1,7 +1,6 @@
#include "remotebackend.hh"
#include <sys/socket.h>
#include <unistd.h>
-#include <sys/select.h>
#include <fcntl.h>
#include <boost/foreach.hpp>
#include <sstream>
Index: modules/remotebackend/unixconnector.cc
===================================================================
--- modules/remotebackend/unixconnector.cc (revision 3115)
+++ modules/remotebackend/unixconnector.cc (working copy)
@@ -2,7 +2,6 @@
#include <sys/socket.h>
#include <pdns/lock.hh>
#include <unistd.h>
-#include <sys/select.h>
#include <fcntl.h>
#ifndef UNIX_PATH_MAX
#define UNIX_PATH_MAX 108
@@ -120,7 +119,6 @@
void UnixsocketConnector::reconnect() {
struct sockaddr_un sock;
struct timeval tv;
- fd_set rd;
rapidjson::Document init,res;
rapidjson::Value val;
@@ -140,11 +138,7 @@
fcntl(fd, F_SETFL, O_NONBLOCK, &fd);
while(connect(fd, reinterpret_cast<struct sockaddr*>(&sock), sizeof sock)==-1 && (errno == EINPROGRESS)) {
- tv.tv_sec = 0;
- tv.tv_usec = 500;
- FD_ZERO(&rd);
- FD_SET(fd, &rd);
- select(fd+1,&rd,NULL,NULL,&tv); // wait a moment
+ waitForData(fd, 0, 500);
}
if (errno != EISCONN && errno != 0) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment