diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-12-03 08:20:07 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-12-03 08:20:07 +0000 |
commit | 9d0badad9cdf5d148264dfc9d4291c93efe231cb (patch) | |
tree | ad6da09084dcc612483236bd1af34940bd1623ae | |
parent | 2534d4fb826a2e20a81bd26e1012949ec8d9f5a5 (diff) |
never bitch about first failure
-rw-r--r-- | lib/libc/yp/yp_first.c | 7 | ||||
-rw-r--r-- | lib/libc/yp/yp_maplist.c | 7 | ||||
-rw-r--r-- | lib/libc/yp/yp_master.c | 7 | ||||
-rw-r--r-- | lib/libc/yp/ypmatch_cache.c | 12 |
4 files changed, 19 insertions, 14 deletions
diff --git a/lib/libc/yp/yp_first.c b/lib/libc/yp/yp_first.c index 7f9ab2790d6..cfe3891ea8f 100644 --- a/lib/libc/yp/yp_first.c +++ b/lib/libc/yp/yp_first.c @@ -30,7 +30,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: yp_first.c,v 1.4 1996/08/19 08:35:09 tholo Exp $"; +static char *rcsid = "$OpenBSD: yp_first.c,v 1.5 1996/12/03 08:20:03 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -62,7 +62,7 @@ yp_first(indomain, inmap, outkey, outkeylen, outval, outvallen) struct ypreq_nokey yprnk; struct dom_binding *ysd; struct timeval tv; - int r; + int tries = 0, r; if (indomain == NULL || *indomain == '\0' || strlen(indomain) > YPMAXDOMAIN || inmap == NULL || @@ -86,7 +86,8 @@ again: r = clnt_call(ysd->dom_client, YPPROC_FIRST, xdr_ypreq_nokey, &yprnk, xdr_ypresp_key_val, &yprkv, tv); if (r != RPC_SUCCESS) { - clnt_perror(ysd->dom_client, "yp_first: clnt_call"); + if (tries++) + clnt_perror(ysd->dom_client, "yp_first: clnt_call"); ysd->dom_vers = -1; goto again; } diff --git a/lib/libc/yp/yp_maplist.c b/lib/libc/yp/yp_maplist.c index afd93c10276..474d1a6394e 100644 --- a/lib/libc/yp/yp_maplist.c +++ b/lib/libc/yp/yp_maplist.c @@ -30,7 +30,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: yp_maplist.c,v 1.4 1996/08/19 08:35:10 tholo Exp $"; +static char *rcsid = "$OpenBSD: yp_maplist.c,v 1.5 1996/12/03 08:20:04 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -57,7 +57,7 @@ yp_maplist(indomain, outmaplist) struct dom_binding *ysd; struct ypresp_maplist ypml; struct timeval tv; - int r; + int tries = 0, r; again: if (_yp_dobind(indomain, &ysd) != 0) @@ -71,7 +71,8 @@ again: r = clnt_call(ysd->dom_client, YPPROC_MAPLIST, xdr_domainname, &indomain, xdr_ypresp_maplist, &ypml, tv); if (r != RPC_SUCCESS) { - clnt_perror(ysd->dom_client, "yp_maplist: clnt_call"); + if (tries++) + clnt_perror(ysd->dom_client, "yp_maplist: clnt_call"); ysd->dom_vers = -1; goto again; } diff --git a/lib/libc/yp/yp_master.c b/lib/libc/yp/yp_master.c index 7b5ce26e1f0..4267dcfb212 100644 --- a/lib/libc/yp/yp_master.c +++ b/lib/libc/yp/yp_master.c @@ -30,7 +30,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: yp_master.c,v 1.4 1996/08/19 08:35:10 tholo Exp $"; +static char *rcsid = "$OpenBSD: yp_master.c,v 1.5 1996/12/03 08:20:05 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -59,7 +59,7 @@ yp_master(indomain, inmap, outname) struct ypresp_master yprm; struct ypreq_nokey yprnk; struct timeval tv; - int r; + int tries = 0, r; if (indomain == NULL || *indomain == '\0' || strlen(indomain) > YPMAXDOMAIN || inmap == NULL || @@ -81,7 +81,8 @@ again: r = clnt_call(ysd->dom_client, YPPROC_MASTER, xdr_ypreq_nokey, &yprnk, xdr_ypresp_master, &yprm, tv); if (r != RPC_SUCCESS) { - clnt_perror(ysd->dom_client, "yp_master: clnt_call"); + if (tries++) + clnt_perror(ysd->dom_client, "yp_master: clnt_call"); ysd->dom_vers = -1; goto again; } 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; } |