    if (connfd < 0)
    {
      int savedErrno = errno;
+diff --git a/muduo/net/SocketsOps.h b/muduo/net/SocketsOps.h
+--- a/muduo/net/SocketsOps.h
++++ b/muduo/net/SocketsOps.h
+@@ -25,6 +25,8 @@ namespace sockets
+ /// abort if any error.
+ int createNonblockingOrDie();
+ 
++void setNonBlockAndCloseOnExec(int sockfd);
++
+ int  connect(int sockfd, const struct sockaddr_in& addr);
+ void bindOrDie(int sockfd, const struct sockaddr_in& addr);
+ void listenOrDie(int sockfd);
 diff --git a/muduo/net/TimerQueue.cc b/muduo/net/TimerQueue.cc
 --- a/muduo/net/TimerQueue.cc
 +++ b/muduo/net/TimerQueue.cc

   t_loopInThisThread = NULL;
 }
 
@@ -108,12 +101,13 @@ void EventLoop::loop()
   while (!quit_)
   {
     activeChannels_.clear();

 
 IgnoreSigPipe initObj;
 }
@@ -69,11 +57,17 @@ EventLoop::EventLoop()
     threadId_(CurrentThread::tid()),
     poller_(Poller::newDefaultPoller(this)),
     timerQueue_(new TimerQueue(this)),
