diff options
Diffstat (limited to 'lib/libc/yp/ypmatch_cache.c')
-rw-r--r-- | lib/libc/yp/ypmatch_cache.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/libc/yp/ypmatch_cache.c b/lib/libc/yp/ypmatch_cache.c index 4f1b8f0f9ee..4f3e5d36d86 100644 --- a/lib/libc/yp/ypmatch_cache.c +++ b/lib/libc/yp/ypmatch_cache.c @@ -30,7 +30,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: ypmatch_cache.c,v 1.5 1996/09/15 09:32:01 tholo Exp $"; +static char *rcsid = "$OpenBSD: ypmatch_cache.c,v 1.6 1996/12/03 08:20:06 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -162,7 +162,7 @@ yp_match(indomain, inmap, inkey, inkeylen, outval, outvallen) struct ypresp_val yprv; struct timeval tv; struct ypreq_key yprk; - int r; + int tries = 0, r; if (indomain == NULL || *indomain == '\0' || strlen(indomain) > YPMAXDOMAIN || inmap == NULL || @@ -205,7 +205,8 @@ again: r = clnt_call(ysd->dom_client, YPPROC_MATCH, xdr_ypreq_key, &yprk, xdr_ypresp_val, &yprv, tv); if (r != RPC_SUCCESS) { - clnt_perror(ysd->dom_client, "yp_match: clnt_call"); + if (tries++) + clnt_perror(ysd->dom_client, "yp_match: clnt_call"); ysd->dom_vers = -1; goto again; } @@ -245,7 +246,7 @@ yp_next(indomain, inmap, inkey, inkeylen, outkey, outkeylen, outval, outvallen) struct ypreq_key yprk; struct dom_binding *ysd; struct timeval tv; - int r; + int tries = 0, r; if (indomain == NULL || *indomain == '\0' || strlen(indomain) > YPMAXDOMAIN || inmap == NULL || @@ -271,7 +272,8 @@ again: r = clnt_call(ysd->dom_client, YPPROC_NEXT, xdr_ypreq_key, &yprk, xdr_ypresp_key_val, &yprkv, tv); if (r != RPC_SUCCESS) { - clnt_perror(ysd->dom_client, "yp_next: clnt_call"); + if (tries++) + clnt_perror(ysd->dom_client, "yp_next: clnt_call"); ysd->dom_vers = -1; goto again; } |