summaryrefslogtreecommitdiff
path: root/lib/libc/rpc/pmap_getport.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-07-09 03:05:07 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-07-09 03:05:07 +0000
commit7ff0c3acc19ffe11a2eab82c222a2a30ba7a10b7 (patch)
tree8d6abbe7934e5ad419c2995bc3cab129fc7a6faa /lib/libc/rpc/pmap_getport.c
parent8feb5b83a9e4e8b3292bd50bdecba817e0c2508b (diff)
avoid close(closed_socket) or close(-1); it looks disgusting in kdump
Diffstat (limited to 'lib/libc/rpc/pmap_getport.c')
-rw-r--r--lib/libc/rpc/pmap_getport.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libc/rpc/pmap_getport.c b/lib/libc/rpc/pmap_getport.c
index 07e21910111..651cf265f6c 100644
--- a/lib/libc/rpc/pmap_getport.c
+++ b/lib/libc/rpc/pmap_getport.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: pmap_getport.c,v 1.4 1996/12/10 07:46:41 deraadt Exp $";
+static char *rcsid = "$OpenBSD: pmap_getport.c,v 1.5 1997/07/09 03:05:04 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -60,13 +60,13 @@ pmap_getport(address, program, version, protocol)
u_int protocol;
{
u_short port = 0;
- int socket = -1;
+ int sock = -1;
register CLIENT *client;
struct pmap parms;
address->sin_port = htons(PMAPPORT);
client = clntudp_bufcreate(address, PMAPPROG,
- PMAPVERS, timeout, &socket, RPCSMALLMSGSIZE, RPCSMALLMSGSIZE);
+ PMAPVERS, timeout, &sock, RPCSMALLMSGSIZE, RPCSMALLMSGSIZE);
if (client != (CLIENT *)NULL) {
parms.pm_prog = program;
parms.pm_vers = version;
@@ -81,8 +81,8 @@ pmap_getport(address, program, version, protocol)
}
CLNT_DESTROY(client);
}
- if (socket != -1)
- (void)close(socket);
+ if (sock != -1)
+ (void)close(sock);
address->sin_port = 0;
return (port);
}