From a9ee361f27e0439530387765924574e5358c8a5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 10 Sep 2022 15:44:41 +0200 Subject: New upstream version 1.8.19 --- src/plugins/dummy/dummy.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'src/plugins/dummy/dummy.c') 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; } -- cgit v1.2.3