summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rpc/rpc-transport/socket/src/socket.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c
index e14152c5822..d59dd6cf49f 100644
--- a/rpc/rpc-transport/socket/src/socket.c
+++ b/rpc/rpc-transport/socket/src/socket.c
@@ -3350,7 +3350,16 @@ handler:
rpc_transport_ref (this);
refd = _gf_true;
- if (priv->own_thread && !(priv->connect_failed)) {
+ if (priv->own_thread) {
+ if (priv->connect_failed) {
+ gf_msg_debug (this->name, 0,
+ "socket connect is failed so close it");
+ sys_close (priv->sock);
+ priv->sock = -1;
+ ret = -1;
+ goto unlock;
+ }
+
if (pipe(priv->pipe) < 0) {
gf_log(this->name,GF_LOG_ERROR,
"could not create pipe");