Adjust patch manually to apply
Undoes effect of e9716e216d970b2c84eff5bde5802a05c202cacb Refactoring: optimize pointer checks and partly of 3bfa1da201997efb5d728b6d1bcbc0825175b5b2 open: fix whitespace Related: rhbz2224569
This commit is contained in:
parent
687d89504a
commit
e21c689588
@ -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;
|
||||
+ }
|
||||
|
Loading…
Reference in New Issue
Block a user