diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-08-22 23:03:12 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-08-22 23:03:12 +0000 |
commit | fb06990844ba5981ac025b0d448e49796f402f43 (patch) | |
tree | d8ffc98e4f090875721a7e46e9497b22545bf6d5 /lib/libc | |
parent | 822613f0ca988ce0642d9605e115e80023c744d7 (diff) |
do not lose errno
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/rpc/pmap_clnt.c | 7 |
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); |