summaryrefslogtreecommitdiffstats
path: root/lib/libc/rpc/clnt_simple.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/rpc/clnt_simple.c')
-rw-r--r--lib/libc/rpc/clnt_simple.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libc/rpc/clnt_simple.c b/lib/libc/rpc/clnt_simple.c
index 20071c9b15f..bc127b03d9a 100644
--- a/lib/libc/rpc/clnt_simple.c
+++ b/lib/libc/rpc/clnt_simple.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: clnt_simple.c,v 1.5 1996/12/10 07:43:34 deraadt Exp $";
+static char *rcsid = "$OpenBSD: clnt_simple.c,v 1.6 1996/12/10 07:46:33 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -80,7 +80,8 @@ callrpc(host, prognum, versnum, procnum, inproc, in, outproc, out)
/* reuse old client */
} else {
crp->valid = 0;
- (void)close(crp->socket);
+ if (crp->socket != -1)
+ (void)close(crp->socket);
crp->socket = RPC_ANYSOCK;
if (crp->client) {
clnt_destroy(crp->client);