static int c_ipmi_active = 0;
static pthread_t thread_id = (pthread_t)0;
-static const char *config_keys[] = {"Sensor", "IgnoreSelected",
- "NotifySensorAdd", "NotifySensorRemove",
- "NotifySensorNotPresent", "SELEnabled",
+static const char *config_keys[] = {"Sensor",
+ "IgnoreSelected",
+ "NotifySensorAdd",
+ "NotifySensorRemove",
+ "NotifySensorNotPresent",
+ "SELEnabled",
"SELClearEvent"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
list_item->sensor_name);
if (c_ipmi_notify_notpresent) {
- notification_t n = {NOTIF_WARNING, cdtime(), "", "", "ipmi", "", "", "", NULL};
+ notification_t n = {
+ NOTIF_WARNING, cdtime(), "", "", "ipmi", "", "", "", NULL};
sstrncpy(n.host, hostname_g, sizeof(n.host));
sstrncpy(n.type_instance, list_item->sensor_name,
list_item->sensor_name);
if (c_ipmi_notify_notpresent) {
- notification_t n = {NOTIF_OKAY, cdtime(), "", "", "ipmi", "", "", "",
- NULL};
+ notification_t n = {NOTIF_OKAY, cdtime(), "", "", "ipmi",
+ "", "", "", NULL};
sstrncpy(n.host, hostname_g, sizeof(n.host));
sstrncpy(n.type_instance, list_item->sensor_name,
pthread_mutex_unlock(&sensor_list_lock);
if (c_ipmi_notify_remove && c_ipmi_active) {
- notification_t n = {NOTIF_WARNING, cdtime(), "", "", "ipmi",
- "", "", "", NULL};
+ notification_t n = {NOTIF_WARNING, cdtime(), "", "", "ipmi", "", "", "",
+ NULL};
sstrncpy(n.host, hostname_g, sizeof(n.host));
sstrncpy(n.type_instance, list_item->sensor_name, sizeof(n.type_instance));
char buf[DATA_MAX_NAME_LEN] = {0};
snprintf(buf, sizeof(buf), "0x%2.2x", raw_value);
plugin_notification_meta_add_string(&n, "raw", buf);
- } break;
+ } break;
default:
break;
} /* switch (value_present) */
/* From the IPMI specification Chapter 2: Events.
* If a callback handles the event, then all future callbacks called due to
* the event will receive a NULL for the event. So be ready to handle a NULL
- * event in all your event handlers. A NULL may also be passed to an event
+ * event in all your event handlers. A NULL may also be passed to an event
* handler if the callback was not due to an event. */
if (event == NULL)
return (IPMI_EVENT_NOT_HANDLED);
if (status) {
char buf[DATA_MAX_NAME_LEN] = {0};
sensor_get_name(sensor, buf, sizeof(buf));
- ERROR("Unable to add sensor %s event handler, status: %d", buf,
- status);
+ ERROR("Unable to add sensor %s event handler, status: %d", buf, status);
}
}
} else if (op == IPMI_DELETED) {
static void smi_event_handler(ipmi_con_t __attribute__((unused)) *ipmi,
const ipmi_addr_t __attribute__((unused)) *addr,
unsigned int __attribute__((unused)) addr_len,
- ipmi_event_t *event,
- void *cb_data) {
+ ipmi_event_t *event, void *cb_data) {
unsigned int type = ipmi_event_get_type(event);
ipmi_domain_t *domain = cb_data;
ipmi_con_t *smi_connection = user_data;
status = smi_connection->add_event_handler(smi_connection, smi_event_handler,
- (void*) domain);
+ (void *)domain);
if (status != 0)
c_ipmi_error("Failed to register smi event handler", status);
return (-1);
}
- ipmi_open_option_t open_option[1] = {[0] = {.option = IPMI_OPEN_OPTION_ALL,
- {.ival = 1}}};
+ ipmi_open_option_t open_option[1] = {
+ [0] = {.option = IPMI_OPEN_OPTION_ALL, {.ival = 1}}};
status = ipmi_open_domain(
"mydomain", &smi_connection, /* num_con = */ 1,
domain_connection_change_handler,
- /* user data = */ (void*) smi_connection,
+ /* user data = */ (void *)smi_connection,
/* domain_fully_up_handler = */ NULL, /* user data = */ NULL, open_option,
sizeof(open_option) / sizeof(open_option[0]), &domain_id);
if (status != 0) {