summaryrefslogtreecommitdiff
path: root/lib/libc/rpc
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-08-20 21:15:41 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-08-20 21:15:41 +0000
commitded455e8761207780ae8037f7fdb7f9d39c3abc7 (patch)
tree8d59708ad7b66e58659d6dc133555c4db48a1daa /lib/libc/rpc
parentb0ef9c9292df43c0b4b0006fc8adcfcb623f7324 (diff)
only close real socket
Diffstat (limited to 'lib/libc/rpc')
-rw-r--r--lib/libc/rpc/pmap_clnt.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/libc/rpc/pmap_clnt.c b/lib/libc/rpc/pmap_clnt.c
index 15625b1fd56..7fac9416c72 100644
--- a/lib/libc/rpc/pmap_clnt.c
+++ b/lib/libc/rpc/pmap_clnt.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: pmap_clnt.c,v 1.5 1996/08/19 08:31:36 tholo Exp $";
+static char *rcsid = "$OpenBSD: pmap_clnt.c,v 1.6 1996/08/20 21:15:40 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -82,7 +82,8 @@ pmap_set(program, version, protocol, port)
return (FALSE);
}
CLNT_DESTROY(client);
- (void)close(socket);
+ if (socket != -1)
+ (void)close(socket);
return (rslt);
}
@@ -114,6 +115,7 @@ pmap_unset(program, version)
CLNT_CALL(client, PMAPPROC_UNSET, xdr_pmap, &parms, xdr_bool, &rslt,
tottimeout);
CLNT_DESTROY(client);
- (void)close(socket);
+ if (socket != -1)
+ (void)close(socket);
return (rslt);
}