summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2002-08-22 23:03:11 +0000
committerderaadt <deraadt@openbsd.org>2002-08-22 23:03:11 +0000
commit530550bc738f91bb8b04aa58a37b5202933d306f (patch)
tree461e6f45b2bc65e36def3f775e61466aac5ef8f0 /lib/libc
parenttweak (diff)
downloadwireguard-openbsd-530550bc738f91bb8b04aa58a37b5202933d306f.tar.xz
wireguard-openbsd-530550bc738f91bb8b04aa58a37b5202933d306f.zip
do not lose errno
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/rpc/pmap_clnt.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/libc/rpc/pmap_clnt.c b/lib/libc/rpc/pmap_clnt.c
index c1d598ef051..efbb882b245 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.10 2001/09/15 13:51:00 deraadt Exp $";
+static char *rcsid = "$OpenBSD: pmap_clnt.c,v 1.11 2002/08/22 23:03:11 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -39,9 +39,11 @@ static char *rcsid = "$OpenBSD: pmap_clnt.c,v 1.10 2001/09/15 13:51:00 deraadt E
*/
#include <unistd.h>
+#include <errno.h>
#include <rpc/rpc.h>
#include <rpc/pmap_prot.h>
#include <rpc/pmap_clnt.h>
+#include <rpc/pmap_clnt.h>
static struct timeval timeout = { 5, 0 };
static struct timeval tottimeout = { 60, 0 };
@@ -76,7 +78,10 @@ pmap_set(program, version, protocol, port)
parms.pm_port = port;
if (CLNT_CALL(client, PMAPPROC_SET, xdr_pmap, &parms, xdr_bool, &rslt,
tottimeout) != RPC_SUCCESS) {
+ int save_errno = errno;
+
clnt_perror(client, "Cannot register service");
+ errno = save_errno;
return (FALSE);
}
CLNT_DESTROY(client);