From 7ff0c3acc19ffe11a2eab82c222a2a30ba7a10b7 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Wed, 9 Jul 1997 03:05:07 +0000 Subject: avoid close(closed_socket) or close(-1); it looks disgusting in kdump --- lib/libc/rpc/pmap_getport.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/libc/rpc/pmap_getport.c') 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); } -- cgit v1.2.3