summaryrefslogtreecommitdiff
path: root/src/plugins/dummy/dummy.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2016-02-20 02:12:42 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2016-02-20 02:12:42 +0100
commita61a5992cefc2204a99f25b2395b108092098e2c (patch)
tree3b25da535866adf0458f6d172fd242fc933c77db /src/plugins/dummy/dummy.c
parent15edf42f095e3cc26e372547ebcaaae558d0cce2 (diff)
parent97d6a2e491c6ed08473beb2c4bac47c5cbc1201a (diff)
Merge tag 'upstream/1.8.16'
Upstream version 1.8.16
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,
};