diff options
| -rw-r--r-- | rpc/rpc-transport/socket/src/socket.c | 19 | 
1 files changed, 7 insertions, 12 deletions
diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c index 6464cd79d0c..686620a47af 100644 --- a/rpc/rpc-transport/socket/src/socket.c +++ b/rpc/rpc-transport/socket/src/socket.c @@ -3056,17 +3056,12 @@ socket_connect (rpc_transport_t *this, int port)  handler:                  if (ret < 0) { -                        if (priv->own_thread) { -                                close(priv->sock); -                                priv->sock = -1; -                        } -                        else { -                                /* Ignore error from connect. epoll events -                                   should be handled in the socket handler. -                                   shutdown(2) will result in EPOLLERR, so -                                   cleanup is done in socket_event_handler */ -                                shutdown (priv->sock, SHUT_RDWR); -                        } +                        /* Ignore error from connect. epoll events +                           should be handled in the socket handler.  shutdown(2) +                           will result in EPOLLERR, so cleanup is done in +                           socket_event_handler or socket_poller */ + +                        shutdown (priv->sock, SHUT_RDWR);                  }                  /* @@ -3078,7 +3073,7 @@ handler:                  rpc_transport_ref (this);                  refd = _gf_true; -                if (!ret && priv->own_thread) { +                if (priv->own_thread) {                          if (pipe(priv->pipe) < 0) {                                  gf_log(this->name,GF_LOG_ERROR,                                  "could not create pipe");  | 
