summaryrefslogtreecommitdiff
path: root/src/plugins/dummy/dummy.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/dummy/dummy.c')
-rw-r--r--src/plugins/dummy/dummy.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/plugins/dummy/dummy.c b/src/plugins/dummy/dummy.c
index eb2d086..8bfc4cf 100644
--- a/src/plugins/dummy/dummy.c
+++ b/src/plugins/dummy/dummy.c
@@ -117,7 +117,7 @@ data_write(int fd, void *data_ptr, int data_len)
/* TODO - add poll() */
data_written = write(fd, data_ptr, data_len);
errno_save = errno;
- if (data_read > 0) {
+ if (data_written > 0) {
data_total+= data_written;
}
if (errno_save != 0) {
@@ -149,9 +149,6 @@ static void
ipmi_dummyipmi_close(struct ipmi_intf *intf)
{
struct dummy_rq req;
- int data_total = 0;
- int data_written = 0;
- int try = 0;
if (intf->fd < 0) {
return;
}
@@ -245,7 +242,7 @@ ipmi_dummyipmi_send_cmd(struct ipmi_intf *intf, struct ipmi_rq *req)
return NULL;
}
}
-
+
memset(&rsp_dummy, 0, sizeof(rsp_dummy));
if (data_read(intf->fd, &rsp_dummy, sizeof(struct dummy_rs)) != 0) {
return NULL;
@@ -276,11 +273,11 @@ ipmi_dummyipmi_send_cmd(struct ipmi_intf *intf, struct ipmi_rq *req)
}
struct ipmi_intf ipmi_dummy_intf = {
- name: "dummy",
- desc: "Linux DummyIPMI Interface",
- open: ipmi_dummyipmi_open,
- close: ipmi_dummyipmi_close,
- sendrecv: ipmi_dummyipmi_send_cmd,
- my_addr: IPMI_BMC_SLAVE_ADDR,
- target_addr: IPMI_BMC_SLAVE_ADDR,
+ .name = "dummy",
+ .desc = "Linux DummyIPMI Interface",
+ .open = ipmi_dummyipmi_open,
+ .close = ipmi_dummyipmi_close,
+ .sendrecv = ipmi_dummyipmi_send_cmd,
+ .my_addr = IPMI_BMC_SLAVE_ADDR,
+ .target_addr = IPMI_BMC_SLAVE_ADDR,
};