Example #1
0
File: yp.c Project: pikelang/Pike
static void exit_yp_struct( struct object *UNUSED(o) )
{
  if(this->domain)
  {
    yp_unbind( this->domain );
    free(this->domain);
  }
}
Example #2
0
void
fix_yp_bugs(void)
{
    char   *mydomain;

    extern int yp_get_default_domain (char **);
    /*
     * PWP: The previous version assumed that yp domain was the same as the
     * internet name domain.  This isn't allways true. (Thanks to Mat Landau
     * <*****@*****.**> for the original version of this.)
     */
    if (yp_get_default_domain(&mydomain) == 0) {	/* if we got a name */
	extern void yp_unbind (const char *);

	yp_unbind(mydomain);
    }
}
Example #3
0
File: yp.c Project: pikelang/Pike
/*! @decl void create(string|void domain)
 *! @decl void bind(string domain)
 *!
 *! If @[domain] is not specified , the default domain will be used.
 *! (As returned by @[Yp.default_domain()]).
 *!
 *! If there is no YP server available for the domain, this
 *! function call will block until there is one. If no server appears
 *! in about ten minutes or so, an error will be returned. This timeout
 *! is not configurable.
 *!
 *! @seealso
 *! @[Yp.default_domain()]
 */
static void f_create(INT32 args)
{
  int err;
  if(!args)
  {
    f_default_domain(0);
    args = 1;
  }
  check_all_args(NULL, args, BIT_STRING,0);

  if(this->domain)
  {
    yp_unbind( this->domain );
    free(this->domain);
  }
  this->domain = strdup( sp[-args].u.string->str );
  err = yp_bind( this->domain );

  YPERROR( err );
}