zabbix-4.2.1/src/zabbix_server/ipmi/checks_ipmi.c
/******************************************************************************
 *                                                                            *
 * Function: zbx_perform_openipmi_ops                                         *
 *                                                                            *
 * Purpose: Pass control to OpenIPMI library to process events                *
 *                                                                            *
 * Return value: SUCCEED - no errors                                          *
 *               FAIL - an error occurred while processing events             *
 *                                                                            *
 ******************************************************************************/


Pass control to OpenIPMI library to process events

Return value: SUCCEED - no errors
FAIL - an error occurred while processing events
Pass control to OpenIPMI library to process events Return value : SUCCEED - no errors FAIL - an error occurred while processing events
static int	zbx_perform_openipmi_ops(zbx_ipmi_host_t *h, const char *func_name)
{
	struct timeval	tv;
	zabbix_log(LOG_LEVEL_DEBUG, "In %s() host:'[%s]:%d' phost:%p from %s()", __func__, h->ip, h->port,
			(void *)h, func_name);
	tv.tv_sec = 10;		
	tv.tv_usec = 0;
	while (0 == h->done)
	{
		int	res;
		if (0 == (res = os_hnd->perform_one_op(os_hnd, &tv)))
			continue;
		zabbix_log(LOG_LEVEL_DEBUG, "End %s() from %s(): error: %s", __func__, func_name, zbx_strerror(res));
		return FAIL;
	}
	zabbix_log(LOG_LEVEL_DEBUG, "End %s() from %s()", __func__, func_name);
	return SUCCEED;
}
static int zbx_perform_openipmi_ops ( zbx_ipmi_host_t * h , const char * func_name ) { struct timeval tv ; zabbix_log ( LOG_LEVEL_DEBUG , " " , __func__ , h -> ip , h -> port , ( void * ) h , func_name ) ; tv . tv_sec = 10 ; tv . tv_usec = 0 ; while ( 0 == h -> done ) { int res ; if ( 0 == ( res = os_hnd -> perform_one_op ( os_hnd , & tv ) ) ) continue ; zabbix_log ( LOG_LEVEL_DEBUG , " " , __func__ , func_name , zbx_strerror ( res ) ) ; return FAIL ; } zabbix_log ( LOG_LEVEL_DEBUG , " " , __func__ , func_name ) ; return SUCCEED ; }
Function: zbx_perform_openipmi_ops
Function : zbx_perform_openipmi_ops
/* set timeout for one operation */