[BACK]Return to yplib.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / lib / libc / yp

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/lib/libc/yp/yplib.c between version 1.43 and 1.44

version 1.43, 2006/11/03 20:18:49 version 1.44, 2012/03/02 17:27:49
Line 67  struct timeval _yplib_timeout = { YPLIB_
Line 67  struct timeval _yplib_timeout = { YPLIB_
 struct timeval _yplib_rpc_timeout = { YPLIB_TIMEOUT / YPLIB_RPC_RETRIES,  struct timeval _yplib_rpc_timeout = { YPLIB_TIMEOUT / YPLIB_RPC_RETRIES,
         1000000 * (YPLIB_TIMEOUT % YPLIB_RPC_RETRIES) / YPLIB_RPC_RETRIES };          1000000 * (YPLIB_TIMEOUT % YPLIB_RPC_RETRIES) / YPLIB_RPC_RETRIES };
 int _yplib_nerrs = 5;  int _yplib_nerrs = 5;
   int _yplib_bindtries = 0;
   
 #ifdef __weak_alias  #ifdef __weak_alias
 __weak_alias(yp_bind, _yp_bind)  __weak_alias(yp_bind, _yp_bind)
 __weak_alias(yp_unbind, _yp_unbind)  __weak_alias(yp_unbind, _yp_unbind)
 __weak_alias(yp_get_default_domain, _yp_get_default_domain)  __weak_alias(yp_get_default_domain, _yp_get_default_domain)
   __weak_alias(yp_setbindtries, _yp_setbindtries)
 #endif  #endif
   
 #ifdef _REENTRANT  #ifdef _REENTRANT
Line 84  static  mutex_t   _ypmutex = MUTEX_INITI
Line 86  static  mutex_t   _ypmutex = MUTEX_INITI
 #endif  #endif
   
 int  int
   yp_setbindtries(int ntries) {
           int old_val = _yplib_bindtries;
   
           if (ntries >= 0)
                   _yplib_bindtries = ntries;
           return old_val;
   }
   
   int
 _yp_dobind(dom, ypdb)  _yp_dobind(dom, ypdb)
         const char     *dom;          const char     *dom;
         struct dom_binding **ypdb;          struct dom_binding **ypdb;
Line 214  trynet:
Line 225  trynet:
                     (xdrproc_t)xdr_ypdomain_wrap_string, &dom,                      (xdrproc_t)xdr_ypdomain_wrap_string, &dom,
                     (xdrproc_t)xdr_ypbind_resp, &ypbr, _yplib_timeout);                      (xdrproc_t)xdr_ypbind_resp, &ypbr, _yplib_timeout);
                 if (r != RPC_SUCCESS) {                  if (r != RPC_SUCCESS) {
                         if (new == 0 && ++nerrs == _yplib_nerrs) {                          if (_yplib_bindtries <= 0 && new == 0 &&
                               ++nerrs == _yplib_nerrs) {
                                 nerrs = 0;                                  nerrs = 0;
                                 fprintf(stderr,                                  fprintf(stderr,
                     "YP server for domain %s not responding, still trying\n",                      "YP server for domain %s not responding, still trying\n",
                                     dom);                                      dom);
                         }                          }
                           else if (_yplib_bindtries > 0 &&
                                    ++nerrs == _yplib_bindtries) {
                                   free(ysd);
                                   return YPERR_YPBIND;
                           }
                         clnt_destroy(client);                          clnt_destroy(client);
                         ysd->dom_vers = -1;                          ysd->dom_vers = -1;
                         goto again;                          goto again;

Legend:
Removed from v.1.43  
changed lines
  Added in v.1.44

CVSweb <webmaster@jp.NetBSD.org>