From df7da8069f277c0b117146127bcac14da6e9ef02 Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Mon, 30 Dec 1996 14:48:28 +0000 Subject: [PATCH] - Don't close an unopened socket Obtained from: a diff of FreeBSD vs. OpenBSD/NetBSD rpc code. --- lib/libc/rpc/pmap_getmaps.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/libc/rpc/pmap_getmaps.c b/lib/libc/rpc/pmap_getmaps.c index 6119fc057515..9dea8670eca1 100644 --- a/lib/libc/rpc/pmap_getmaps.c +++ b/lib/libc/rpc/pmap_getmaps.c @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)pmap_getmaps.c 1.10 87/08/11 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)pmap_getmaps.c 2.2 88/08/01 4.0 RPCSRC";*/ -static char *rcsid = "$Id: pmap_getmaps.c,v 1.3 1995/10/22 14:51:29 phk Exp $"; +static char *rcsid = "$Id: pmap_getmaps.c,v 1.4 1996/06/10 00:49:17 jraynard Exp $"; #endif /* @@ -79,7 +79,8 @@ pmap_getmaps(address) } CLNT_DESTROY(client); } - (void)close(socket); + if (socket != -1) + (void)close(socket); address->sin_port = 0; return (head); }