CODE EXAMPLE 1-1 System Watchdog Node Management Code Example (Continued)
}
return (err);
}
/*
*This function is the callback function that gets called
*due to picl_walk_tree_by_class call from set_wd_params function.
*This function checks if the given controller node has the
*of interest and then changes the timeout and action of that timer.
*/ static int
wd_set_params(picl_nodehdl_t nodeh, void *args)
{
int err = PICL_SUCCESS;
char | *ptr = NULL; |
char | cntrl_name[PICL_PROPNAMELEN_MAX]; |
char wd_name[PICL_PROPNAMELEN_MAX]; picl_nodehdl_t childh, peerh;
wdadm_args_t | *wd_arg | = | NULL; |
char | *status | = | NULL; |
wd_arg = (wdadm_args_t *)args;
if (wd_arg == NULL
/* get the name of the controller */
err = picl_get_propval_by_name(nodeh, PICL_PROP_NAME, (void *)cntrl_name, PICL_PROPNAMELEN_MAX);
if (err != PICL_SUCCESS) { print_errmsg(gettext(err_msg[EM_GETPVALBYNAME]),
picl_strerror(err)); return (err);
}
/*
*name is of cntrl:node_name format (user input)
*do the parsing to extract controller name and
*name
*/
ptr =
(void) fprintf(stderr, "%s:Node not found:%d\n", prog, picl2errno(PICL_NODENOTFOUND));
return (PICL_NODENOTFOUND);
}
/* check if the controller is of interest */
Chapter 1 Watchdog Timer 13