diff options
-rw-r--r-- | vxi11_server.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/vxi11_server.c b/vxi11_server.c index 79ff9f7..11fdf87 100644 --- a/vxi11_server.c +++ b/vxi11_server.c @@ -523,6 +523,18 @@ create_intr_chan_1_svc(Device_RemoteFunc *argp, struct svc_req *rqstp) { printf("Client %s is asking for an interrupt connection on port %u\n", clientaddressstring, (unsigned int) argp->hostPort); #endif + + // if a client had an interrupt channel and died without closing it + // we need to clean it up to avoid a deadlock + static struct rpc_err err; + if (intclient != NULL) { + clnt_geterr(intclient, &err); + if (err.re_errno != 0) { + clnt_destroy(intclient); + intclient = NULL; + } + } + if (argp->progFamily != DEVICE_TCP || argp->progNum != DEVICE_INTR || argp->progVers != DEVICE_INTR_VERSION) result.error = ERR_OPERATIONNOTSUPPORTED; else if (intclient != NULL) { |