plugins: open: Properly enable event receiver (#35)

The ioctl to enable the event receiver in the OpenIPMI interface is
called with an argument of 0, which tells OpenIPMI to disable it. Set
the argument to 1 instead so that it will be enabled.

Signed-off-by: Benjamin Fair <benjaminfair@google.com>
This commit is contained in:
BenjaminFair 2018-09-09 04:48:58 -07:00 committed by Alexander Amelkin
parent 2ed677c388
commit c70665c3d1

View File

@ -91,8 +91,6 @@ extern int verbose;
static int
ipmi_openipmi_open(struct ipmi_intf * intf)
{
int i = 0;
char ipmi_dev[16];
char ipmi_devfs[16];
char ipmi_devfs2[16];
@ -119,7 +117,9 @@ ipmi_openipmi_open(struct ipmi_intf * intf)
}
}
if (ioctl(intf->fd, IPMICTL_SET_GETS_EVENTS_CMD, &i) < 0) {
int receive_events = TRUE;
if (ioctl(intf->fd, IPMICTL_SET_GETS_EVENTS_CMD, &receive_events) < 0) {
lperror(LOG_ERR, "Could not enable event receiver");
return -1;
}