summaryrefslogtreecommitdiff
path: root/src/plugins/dummy/dummy.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2022-10-30 18:12:02 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2022-10-30 18:12:02 +0100
commit1f3c9b4ae26ce1d46d954d509b83b8684ada5625 (patch)
tree260b922ec4d5d153cc6db745e27931cfd464472f /src/plugins/dummy/dummy.c
parent8fcf0ba6f182918bd584bb80bf0b8998acad26a8 (diff)
parent8b758ee941f4c1ffea0532caa74b1fcd8101d1d8 (diff)
Merge branch 'release/debian/1.8.19-1'debian/1.8.19-1
Diffstat (limited to 'src/plugins/dummy/dummy.c')
-rw-r--r--src/plugins/dummy/dummy.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/plugins/dummy/dummy.c b/src/plugins/dummy/dummy.c
index 8600a84..3a86656 100644
--- a/src/plugins/dummy/dummy.c
+++ b/src/plugins/dummy/dummy.c
@@ -179,10 +179,9 @@ ipmi_dummyipmi_open(struct ipmi_intf *intf)
char *dummy_sock_path;
dummy_sock_path = getenv("IPMI_DUMMY_SOCK");
- if (dummy_sock_path == NULL) {
- lprintf(LOG_DEBUG, "No IPMI_DUMMY_SOCK set. Dummy mode ON.");
- intf->opened = 1;
- return intf->fd;
+ if (!dummy_sock_path) {
+ lprintf(LOG_DEBUG, "No IPMI_DUMMY_SOCK set. Using " IPMI_DUMMY_DEFAULTSOCK);
+ dummy_sock_path = IPMI_DUMMY_DEFAULTSOCK;
}
if (intf->opened == 1) {
@@ -218,13 +217,8 @@ ipmi_dummyipmi_send_cmd(struct ipmi_intf *intf, struct ipmi_rq *req)
static struct ipmi_rs rsp;
struct dummy_rq req_dummy;
struct dummy_rs rsp_dummy;
- char *dummy_sock_path;
- dummy_sock_path = getenv("IPMI_DUMMY_SOCK");
- if (dummy_sock_path == NULL) {
- lprintf(LOG_DEBUG, "No IPMI_DUMMY_SOCK set. Dummy mode ON.");
- return NULL;
- }
- if (intf == NULL || intf->fd < 0 || intf->opened != 1) {
+
+ if (!intf || intf->fd < 0 || intf->opened != 1) {
lprintf(LOG_ERR, "dummy failed on intf check.");
return NULL;
}