2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 06:15:24 +00:00

dump: Make VMA parsing to handle absence of map_files

Needed in testing purposes. Also make free_mappings
being a global one (will need it in restorer).

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
Cyrill Gorcunov
2011-10-26 22:48:10 +04:00
parent 214b8a6a27
commit 2cc7488de2
4 changed files with 7 additions and 5 deletions

4
util.c
View File

@@ -231,7 +231,7 @@ int reopen_fd_as(int new_fd, int old_fd)
return new_fd;
}
int parse_maps(pid_t pid, struct list_head *vma_area_list)
int parse_maps(pid_t pid, struct list_head *vma_area_list, bool use_map_files)
{
struct vma_area *vma_area = NULL;
u64 start, end, pgoff;
@@ -260,7 +260,7 @@ int parse_maps(pid_t pid, struct list_head *vma_area_list)
* I'm debugging it on old kernel ;)
*/
map_files_dir = opendir(map_files_path);
if (!map_files_dir) {
if (use_map_files && !map_files_dir) {
pr_err("Can't open %s, old kernel?\n",
map_files_path);
goto err;