Commit 83c209ef authored by Cyrill Gorcunov's avatar Cyrill Gorcunov

Move vma prot setup into parsing helper

To shrink restorer code.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@gmail.com>
parent 35502c45
......@@ -217,9 +217,6 @@ self_len_end:
if (!(vma_entry.status & VMA_AREA_REGULAR))
continue;
if (vma_entry.status & VMA_AREA_STACK)
vma_entry.prot |= PROT_GROWSDOWN;
#if 0
vma_entry.fd = -1UL; /* for a while */
vma_entry.pgoff = 0;
......
......@@ -329,16 +329,18 @@ int parse_maps(pid_t pid, struct list_head *vma_area_list, bool use_map_files)
vma_area->vma.status = 0;
if (strstr(big_buffer, "[stack]"))
if (strstr(big_buffer, "[stack]")) {
vma_area->vma.status |= VMA_AREA_REGULAR | VMA_AREA_STACK;
else if (strstr(big_buffer, "[vsyscall]"))
vma_area->vma.prot |= PROT_GROWSDOWN;
} else if (strstr(big_buffer, "[vsyscall]")) {
vma_area->vma.status |= VMA_AREA_VSYSCALL;
else if (strstr(big_buffer, "[vdso]"))
} else if (strstr(big_buffer, "[vdso]")) {
vma_area->vma.status |= VMA_AREA_VDSO;
else if (strstr(big_buffer, "[heap]"))
} else if (strstr(big_buffer, "[heap]")) {
vma_area->vma.status |= VMA_AREA_REGULAR | VMA_AREA_HEAP;
else
} else {
vma_area->vma.status = VMA_AREA_REGULAR;
}
/*
* Some mapping hints for restore, we save this on
......
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