diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2022-09-10 15:44:41 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2022-09-10 15:44:41 +0200 |
commit | a9ee361f27e0439530387765924574e5358c8a5c (patch) | |
tree | 3104aecc4d574f7d7bbb269223814586277b1797 /src/plugins/dummy/dummy.c | |
parent | 82ac6c87ce0b0af2fb8de25d70442fec406bb742 (diff) |
New upstream version 1.8.19upstream/1.8.19upstream
Diffstat (limited to 'src/plugins/dummy/dummy.c')
-rw-r--r-- | src/plugins/dummy/dummy.c | 16 |
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; } |