1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-21 11:13:30 +00:00

- dont close an unopen socket

Obtained from: a diff of FreeBSD vs. OpenBSD/NetBSD rpc code.
This commit is contained in:
Peter Wemm 1996-12-30 14:49:24 +00:00
parent df7da8069f
commit fadfbc36c6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=21080

View File

@ -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);
}