[PATCH 15/18] user-cr: Zero-length reads on zero-length payloads are OK

Matt Helsley matthltc at us.ibm.com
Thu Mar 17 10:27:47 PDT 2011


Signed-off-by: Matt Helsley <matthltc at us.ibm.com>
---
 ckptinfo.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/ckptinfo.c b/ckptinfo.c
index 78fc279..76430b6 100644
--- a/ckptinfo.c
+++ b/ckptinfo.c
@@ -207,7 +207,8 @@ static int image_read_obj(int fd, struct ckpt_hdr **hh)
 	*p = h;
 
 	ret = __image_read(fd, (p + 1), h.len - sizeof(h));
-	if (ret <= 0) {
+	if (ret < 0) {
+		fprintf(stderr, "read of image failed\n");
 		free(p);
 		return -1;
 	}
-- 
1.6.3.3



More information about the Containers mailing list