diff options
author | 1996-08-20 21:15:40 +0000 | |
---|---|---|
committer | 1996-08-20 21:15:40 +0000 | |
commit | 493ed72cdbd55088bd1c5d835fa80abc8d2ee644 (patch) | |
tree | 3465d69d53eecf81dae8c1bac91aee95d7d86cf1 /lib | |
parent | deal with unintializated __svc_fdset (diff) | |
download | wireguard-openbsd-493ed72cdbd55088bd1c5d835fa80abc8d2ee644.tar.xz wireguard-openbsd-493ed72cdbd55088bd1c5d835fa80abc8d2ee644.zip |
only close real socket
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/rpc/pmap_clnt.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/libc/rpc/pmap_clnt.c b/lib/libc/rpc/pmap_clnt.c index 15625b1fd56..7fac9416c72 100644 --- a/lib/libc/rpc/pmap_clnt.c +++ b/lib/libc/rpc/pmap_clnt.c @@ -28,7 +28,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: pmap_clnt.c,v 1.5 1996/08/19 08:31:36 tholo Exp $"; +static char *rcsid = "$OpenBSD: pmap_clnt.c,v 1.6 1996/08/20 21:15:40 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ /* @@ -82,7 +82,8 @@ pmap_set(program, version, protocol, port) return (FALSE); } CLNT_DESTROY(client); - (void)close(socket); + if (socket != -1) + (void)close(socket); return (rslt); } @@ -114,6 +115,7 @@ pmap_unset(program, version) CLNT_CALL(client, PMAPPROC_UNSET, xdr_pmap, &parms, xdr_bool, &rslt, tottimeout); CLNT_DESTROY(client); - (void)close(socket); + if (socket != -1) + (void)close(socket); return (rslt); } |