diff options
author | peter <peter@FreeBSD.org> | 1996-12-30 14:49:24 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1996-12-30 14:49:24 +0000 |
commit | fda0320ff7886a8cb08bbc107fbe50642eb1fc90 (patch) | |
tree | 60b0bf8f7dba5d31c17a9c9d4e40ad7657288f4d /lib | |
parent | e66dd049881a130a1c95a047483e97eb2375cc18 (diff) | |
download | FreeBSD-src-fda0320ff7886a8cb08bbc107fbe50642eb1fc90.zip FreeBSD-src-fda0320ff7886a8cb08bbc107fbe50642eb1fc90.tar.gz |
- dont close an unopen socket
Obtained from: a diff of FreeBSD vs. OpenBSD/NetBSD rpc code.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/rpc/pmap_getport.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libc/rpc/pmap_getport.c b/lib/libc/rpc/pmap_getport.c index dd63a37..0ddab7e 100644 --- a/lib/libc/rpc/pmap_getport.c +++ b/lib/libc/rpc/pmap_getport.c @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)pmap_getport.c 1.9 87/08/11 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)pmap_getport.c 2.2 88/08/01 4.0 RPCSRC";*/ -static char *rcsid = "$Id: pmap_getport.c,v 1.2 1995/05/30 05:41:24 rgrimes Exp $"; +static char *rcsid = "$Id: pmap_getport.c,v 1.3 1995/10/22 14:51:31 phk Exp $"; #endif /* @@ -84,7 +84,8 @@ pmap_getport(address, program, version, protocol) } CLNT_DESTROY(client); } - (void)close(socket); + if (socket != -1) + (void)close(socket); address->sin_port = 0; return (port); } |