diff options
author | Ian Kent <raven@themaw.net> | 2016-06-02 10:44:14 -0400 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2016-06-02 10:47:44 -0400 |
commit | 45ceae856f314f7367695e81e835ba4b306cd335 (patch) | |
tree | 64168c3ecdb85bc9b0bc3db5f82a4d93c08b13e3 /src | |
parent | 644b861b01a0b53a9b920e50f68e4f1252000bbd (diff) | |
download | ti-rpc-45ceae856f314f7367695e81e835ba4b306cd335.tar.gz |
handle concurrent connect calls in clnt_vc_create()
Now that the mutex is no longer held during possible connect(2) calls
in clnt_vc_create() it's possible for multiple threads to attempt the
connect concurrently.
So an EISCON error return is not failure case, handle it.
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/clnt_vc.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/clnt_vc.c b/src/clnt_vc.c index 0f018d5..a5fbe2f 100644 --- a/src/clnt_vc.c +++ b/src/clnt_vc.c @@ -247,11 +247,13 @@ clnt_vc_create(fd, raddr, prog, vers, sendsz, recvsz) goto err; } if (connect(fd, (struct sockaddr *)raddr->buf, raddr->len) < 0){ - struct rpc_createerr *ce = &get_rpc_createerr(); - ce->cf_stat = RPC_SYSTEMERROR; - ce->cf_error.re_errno = errno; - thr_sigsetmask(SIG_SETMASK, &(mask), NULL); - goto err; + if (errno != EISCONN) { + struct rpc_createerr *ce = &get_rpc_createerr(); + ce->cf_stat = RPC_SYSTEMERROR; + ce->cf_error.re_errno = errno; + thr_sigsetmask(SIG_SETMASK, &(mask), NULL); + goto err; + } } } if (!__rpc_fd2sockinfo(fd, &si)) |