Commit eaea8f25 authored by Konstantin Khlebnikov's avatar Konstantin Khlebnikov Committed by Pavel Emelyanov

zdtm: maps02: fix detecting VmFlags absence

#PSBM-19883
Signed-off-by: 's avatarKonstantin Khlebnikov <khlebnikov@openvz.org>
Acked-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 8e72d968
...@@ -115,6 +115,7 @@ static int get_smaps_bits(unsigned long where, unsigned long *flags, unsigned lo ...@@ -115,6 +115,7 @@ static int get_smaps_bits(unsigned long where, unsigned long *flags, unsigned lo
unsigned long start = 0, end = 0; unsigned long start = 0, end = 0;
FILE *smaps = NULL; FILE *smaps = NULL;
char buf[1024]; char buf[1024];
int found = 0;
if (!where) if (!where)
return 0; return 0;
...@@ -129,6 +130,7 @@ static int get_smaps_bits(unsigned long where, unsigned long *flags, unsigned lo ...@@ -129,6 +130,7 @@ static int get_smaps_bits(unsigned long where, unsigned long *flags, unsigned lo
is_vma_range_fmt(buf, &start, &end); is_vma_range_fmt(buf, &start, &end);
if (!strncmp(buf, "VmFlags: ", 9) && start == where) { if (!strncmp(buf, "VmFlags: ", 9) && start == where) {
found = 1;
parse_vmflags(buf, flags, madv); parse_vmflags(buf, flags, madv);
break; break;
} }
...@@ -136,7 +138,7 @@ static int get_smaps_bits(unsigned long where, unsigned long *flags, unsigned lo ...@@ -136,7 +138,7 @@ static int get_smaps_bits(unsigned long where, unsigned long *flags, unsigned lo
fclose(smaps); fclose(smaps);
if (start == end) { if (!found) {
err("VmFlags not found for %lx\n", where); err("VmFlags not found for %lx\n", where);
return -1; return -1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment