[Skiboot] [PATCH RFC 1/5] external/opal-prd: send socket response in the error path
Neelesh Gupta
neelegup at linux.vnet.ibm.com
Wed Jul 29 02:42:36 AEST 2015
The server should send the response in the case of error too,
so that the waiting client is not blocked forever.
Signed-off-by: Neelesh Gupta <neelegup at linux.vnet.ibm.com>
---
external/opal-prd/opal-prd.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/external/opal-prd/opal-prd.c b/external/opal-prd/opal-prd.c
index 9f686c5..88b2350 100644
--- a/external/opal-prd/opal-prd.c
+++ b/external/opal-prd/opal-prd.c
@@ -1022,7 +1022,8 @@ static int handle_prd_control(struct opal_prd_ctx *ctx, int fd)
if (rc != sizeof(msg)) {
pr_log(LOG_WARNING, "CTRL: failed to receive "
"control message: %m");
- return -1;
+ rc = -1;
+ goto out_send;
}
enabled = false;
@@ -1065,6 +1066,7 @@ static int handle_prd_control(struct opal_prd_ctx *ctx, int fd)
msg.type);
}
+out_send:
/* send a response */
msg.response = rc;
rc = send(fd, &msg, sizeof(msg), MSG_DONTWAIT | MSG_NOSIGNAL);
More information about the Skiboot
mailing list