[CRIU] [PATCH] zdtm: maps02: fix detecting VmFlags absence

Konstantin Khlebnikov khlebnikov at openvz.org
Tue May 14 06:29:07 EDT 2013


https://jira.sw.ru/browse/PSBM-19883

Signed-off-by: Konstantin Khlebnikov <khlebnikov at openvz.org>
---
 test/zdtm/live/static/maps02.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/test/zdtm/live/static/maps02.c b/test/zdtm/live/static/maps02.c
index f0949df..b0fc0f4 100644
--- a/test/zdtm/live/static/maps02.c
+++ b/test/zdtm/live/static/maps02.c
@@ -115,6 +115,7 @@ static int get_smaps_bits(unsigned long where, unsigned long *flags, unsigned lo
 	unsigned long start = 0, end = 0;
 	FILE *smaps = NULL;
 	char buf[1024];
+	int found = 0;
 
 	if (!where)
 		return 0;
@@ -129,6 +130,7 @@ static int get_smaps_bits(unsigned long where, unsigned long *flags, unsigned lo
 		is_vma_range_fmt(buf, &start, &end);
 
 		if (!strncmp(buf, "VmFlags: ", 9) && start == where) {
+			found = 1;
 			parse_vmflags(buf, flags, madv);
 			break;
 		}
@@ -136,7 +138,7 @@ static int get_smaps_bits(unsigned long where, unsigned long *flags, unsigned lo
 
 	fclose(smaps);
 
-	if (start == end) {
+	if (!found) {
 		err("VmFlags not found for %lx\n", where);
 		return -1;
 	}



More information about the CRIU mailing list