summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRick Macklem <rmacklem@FreeBSD.org>2011-04-27 18:19:26 +0000
committerRick Macklem <rmacklem@FreeBSD.org>2011-04-27 18:19:26 +0000
commit7b67bd9f3dcc59ca1721363afab513cb993e77f9 (patch)
treeee0c9845f07e58264646801249ae55250ef3edae
parent4d2ede67985020a26d980f6cfbd37bae0f59ce34 (diff)
Notes
-rw-r--r--sys/rpc/clnt.h3
-rw-r--r--sys/rpc/clnt_rc.c2
-rw-r--r--sys/rpc/clnt_vc.c10
-rw-r--r--sys/rpc/rpcb_clnt.c2
4 files changed, 11 insertions, 6 deletions
diff --git a/sys/rpc/clnt.h b/sys/rpc/clnt.h
index 74d581373ece..e4da36a12186 100644
--- a/sys/rpc/clnt.h
+++ b/sys/rpc/clnt.h
@@ -433,10 +433,11 @@ extern CLIENT *clnt_dg_create(struct socket *so,
* rpcvers_t vers; -- version number
* size_t sendsz; -- buffer recv size
* size_t recvsz; -- buffer send size
+ * int intrflag; -- is it interruptible
*/
extern CLIENT *clnt_vc_create(struct socket *so,
struct sockaddr *svcaddr, rpcprog_t program, rpcvers_t version,
- size_t sendsz, size_t recvsz);
+ size_t sendsz, size_t recvsz, int intrflag);
/*
* struct netconfig *nconf; -- network type
diff --git a/sys/rpc/clnt_rc.c b/sys/rpc/clnt_rc.c
index 24fc09a3605b..e2632788c7be 100644
--- a/sys/rpc/clnt_rc.c
+++ b/sys/rpc/clnt_rc.c
@@ -195,7 +195,7 @@ clnt_reconnect_connect(CLIENT *cl)
else
newclient = clnt_vc_create(so,
(struct sockaddr *) &rc->rc_addr, rc->rc_prog, rc->rc_vers,
- rc->rc_sendsz, rc->rc_recvsz);
+ rc->rc_sendsz, rc->rc_recvsz, rc->rc_intr);
td->td_ucred = oldcred;
if (!newclient) {
diff --git a/sys/rpc/clnt_vc.c b/sys/rpc/clnt_vc.c
index b94526d5b5dc..ea3b7d10f243 100644
--- a/sys/rpc/clnt_vc.c
+++ b/sys/rpc/clnt_vc.c
@@ -168,7 +168,8 @@ clnt_vc_create(
const rpcprog_t prog, /* program number */
const rpcvers_t vers, /* version number */
size_t sendsz, /* buffer recv size */
- size_t recvsz) /* buffer send size */
+ size_t recvsz, /* buffer send size */
+ int intrflag) /* interruptible */
{
CLIENT *cl; /* client handle */
struct ct_data *ct = NULL; /* client handle */
@@ -177,7 +178,7 @@ clnt_vc_create(
static uint32_t disrupt;
struct __rpc_sockinfo si;
XDR xdrs;
- int error, interrupted, one = 1;
+ int error, interrupted, one = 1, sleep_flag;
struct sockopt sopt;
if (disrupt == 0)
@@ -196,10 +197,13 @@ clnt_vc_create(
error = soconnect(so, raddr, curthread);
SOCK_LOCK(so);
interrupted = 0;
+ sleep_flag = PSOCK;
+ if (intrflag != 0)
+ sleep_flag |= (PCATCH | PBDRY);
while ((so->so_state & SS_ISCONNECTING)
&& so->so_error == 0) {
error = msleep(&so->so_timeo, SOCK_MTX(so),
- PSOCK | PCATCH | PBDRY, "connec", 0);
+ sleep_flag, "connec", 0);
if (error) {
if (error == EINTR || error == ERESTART)
interrupted = 1;
diff --git a/sys/rpc/rpcb_clnt.c b/sys/rpc/rpcb_clnt.c
index 9b23fb32e5d9..d484df3bf4f8 100644
--- a/sys/rpc/rpcb_clnt.c
+++ b/sys/rpc/rpcb_clnt.c
@@ -477,7 +477,7 @@ local_rpcb()
tsize = __rpc_get_t_size(AF_LOCAL, 0, 0);
client = clnt_vc_create(so, (struct sockaddr *)&sun, (rpcprog_t)RPCBPROG,
- (rpcvers_t)RPCBVERS, tsize, tsize);
+ (rpcvers_t)RPCBVERS, tsize, tsize, 1);
if (client != NULL) {
/* Mark the socket to be closed in destructor */