From e21c6895885145b5c3289d709d88cd10d6937bce Mon Sep 17 00:00:00 2001 From: Pavel Cahyna Date: Thu, 27 Jul 2023 13:56:58 +0200 Subject: [PATCH] Adjust patch manually to apply Undoes effect of e9716e216d970b2c84eff5bde5802a05c202cacb Refactoring: optimize pointer checks and partly of 3bfa1da201997efb5d728b6d1bcbc0825175b5b2 open: fix whitespace Related: rhbz2224569 --- ...-received-msg-id-against-expectation.patch | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/0021-open-checking-received-msg-id-against-expectation.patch b/0021-open-checking-received-msg-id-against-expectation.patch index 416f5d0..ea57de1 100644 --- a/0021-open-checking-received-msg-id-against-expectation.patch +++ b/0021-open-checking-received-msg-id-against-expectation.patch @@ -25,22 +25,22 @@ diff --git a/src/plugins/open/open.c b/src/plugins/open/open.c index 4fdabeb..8761a6d 100644 --- a/src/plugins/open/open.c +++ b/src/plugins/open/open.c -@@ -342,48 +342,61 @@ ipmi_openipmi_send_cmd(struct ipmi_intf *intf, struct ipmi_rq *req) +@@ -336,48 +336,61 @@ ipmi_openipmi_send_cmd(struct ipmi_intf *intf, struct ipmi_rq *req) read_timeout.tv_sec = IPMI_OPENIPMI_READ_TIMEOUT; read_timeout.tv_usec = 0; do { -- retval = select(intf->fd + 1, &rset, NULL, NULL, &read_timeout); +- retval = select(intf->fd+1, &rset, NULL, NULL, &read_timeout); - } while (retval < 0 && errno == EINTR); - if (retval < 0) { - lperror(LOG_ERR, "I/O Error"); -- if (data) { +- if (data != NULL) { - free(data); - data = NULL; - } - return NULL; - } else if (retval == 0) { - lprintf(LOG_ERR, "No data available"); -- if (data) { +- if (data != NULL) { - free(data); - data = NULL; - } @@ -48,7 +48,7 @@ index 4fdabeb..8761a6d 100644 - } - if (FD_ISSET(intf->fd, &rset) == 0) { - lprintf(LOG_ERR, "No data available"); -- if (data) { +- if (data != NULL) { - free(data); - data = NULL; + do { @@ -56,14 +56,14 @@ index 4fdabeb..8761a6d 100644 + } while (retval < 0 && errno == EINTR); + if (retval < 0) { + lperror(LOG_ERR, "I/O Error"); -+ if (data) { ++ if (data != NULL) { + free(data); + data = NULL; + } + return NULL; + } else if (retval == 0) { + lprintf(LOG_ERR, "No data available"); -+ if (data) { ++ if (data != NULL) { + free(data); + data = NULL; + } @@ -72,7 +72,7 @@ index 4fdabeb..8761a6d 100644 - return NULL; - } - -- recv.addr = (unsigned char *)&addr; +- recv.addr = (unsigned char *) &addr; - recv.addr_len = sizeof(addr); - recv.msg.data = rsp.data; - recv.msg.data_len = sizeof(rsp.data); @@ -83,7 +83,7 @@ index 4fdabeb..8761a6d 100644 - if (errno != EMSGSIZE) { + if (FD_ISSET(intf->fd, &rset) == 0) { + lprintf(LOG_ERR, "No data available"); - if (data) { + if (data != NULL) { free(data); data = NULL; } @@ -100,7 +100,7 @@ index 4fdabeb..8761a6d 100644 + if (ioctl(intf->fd, IPMICTL_RECEIVE_MSG_TRUNC, &recv) < 0) { + lperror(LOG_ERR, "Error receiving message"); + if (errno != EMSGSIZE) { -+ if (data) { ++ if (data != NULL) { + free(data); + data = NULL; + }