diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2016-02-20 02:12:40 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2016-02-20 02:12:40 +0100 |
commit | 97d6a2e491c6ed08473beb2c4bac47c5cbc1201a (patch) | |
tree | 728b931c62b22ea55a13b292f6f77930897067fd /src/plugins/dummy/dummy.c | |
parent | 55031e72e6c02b4ae63e9052bad1a4b40002ac18 (diff) |
Imported Upstream version 1.8.16upstream/1.8.16
Diffstat (limited to 'src/plugins/dummy/dummy.c')
-rw-r--r-- | src/plugins/dummy/dummy.c | 21 |
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, }; |