Blame SOURCES/0020-plugins-open-Fix-for-interrupted-select.patch

f46373
From f222df3081d965051be76b85ea52b4aff222edf1 Mon Sep 17 00:00:00 2001
f46373
From: "William A. Kennington III" <wak@google.com>
f46373
Date: Fri, 15 Jun 2018 14:47:12 -0700
f46373
Subject: [PATCH] plugins/open: Fix for interrupted select
f46373
f46373
The select syscall can be interrupted for signals like SIGPROF. The IPMI
f46373
command sent will still be outstanding but the send_command will return
f46373
an error. When the next command is sent it will get the completion for
f46373
the previous command and has the tendency to break state of end users.
f46373
f46373
Signed-off-by: William A. Kennington III <wak@google.com>
f46373
---
f46373
 src/plugins/open/open.c | 4 +++-
f46373
 1 file changed, 3 insertions(+), 1 deletion(-)
f46373
f46373
diff --git a/src/plugins/open/open.c b/src/plugins/open/open.c
f46373
index 5beeac7..59b736d 100644
f46373
--- a/src/plugins/open/open.c
f46373
+++ b/src/plugins/open/open.c
f46373
@@ -335,7 +335,9 @@ ipmi_openipmi_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req)
f46373
 	FD_SET(intf->fd, &rset);
f46373
 	read_timeout.tv_sec = IPMI_OPENIPMI_READ_TIMEOUT;
f46373
 	read_timeout.tv_usec = 0;
f46373
-	retval = select(intf->fd+1, &rset, NULL, NULL, &read_timeout);
f46373
+	do {
f46373
+		retval = select(intf->fd+1, &rset, NULL, NULL, &read_timeout);
f46373
+	} while (retval < 0 && errno == EINTR);
f46373
 	if (retval < 0) {
f46373
 	   lperror(LOG_ERR, "I/O Error");
f46373
 	   if (data != NULL) {
f46373
-- 
f46373
2.40.1
f46373