[CRIU] [PATCH 2/5] service: recv_criu_msg() return the number of msgs read

Ruslan Kuprieiev kupruser at gmail.com
Tue Dec 3 08:20:36 PST 2013


Signed-off-by: Ruslan Kuprieiev <kupruser at gmail.com>
---
 cr-service.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/cr-service.c b/cr-service.c
index 53de02b..11d272e 100644
--- a/cr-service.c
+++ b/cr-service.c
@@ -33,13 +33,16 @@ static int recv_criu_msg(int socket_fd, CriuReq **msg)
 		return -1;
 	}
 
+	if (len == 0)
+		return 0;
+
 	*msg = criu_req__unpack(NULL, len, buf);
 	if (!*msg) {
 		pr_perror("Failed unpacking request");
 		return -1;
 	}
 
-	return 0;
+	return 1;
 }
 
 static int send_criu_msg(int socket_fd, CriuResp *msg)
-- 
1.8.1.2



More information about the CRIU mailing list