[CRIU] service: Handle client unexpected disconnection

Pavel Emelyanov xemul at parallels.com
Fri Jan 10 06:28:42 PST 2014


Signed-off-by: Pavel Emelyanov <xemul at parallels.com>

---

diff --git a/cr-service.c b/cr-service.c
index ac89875..e63ee44 100644
--- a/cr-service.c
+++ b/cr-service.c
@@ -35,6 +35,12 @@ static int recv_criu_msg(int socket_fd, CriuReq **msg)
 		return -1;
 	}
 
+	if (len == 0) {
+		pr_info("Client exited unexpectedly\n");
+		errno = ECONNRESET;
+		return -1;
+	}
+
 	*msg = criu_req__unpack(NULL, len, buf);
 	if (!*msg) {
 		pr_perror("Failed unpacking request");


More information about the CRIU mailing list