[CRIU] [PATCH] dump: Decouple dump_filemap_t types
Pavel Emelyanov
xemul at virtuozzo.com
Tue Aug 16 07:21:53 PDT 2016
There are files that include both vma.h and proc_parse.h and
since dump_filemap_t is declared in both some gccs generate
a warning.
Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>
---
diff --git a/criu/cr-dump.c b/criu/cr-dump.c
index 1393cad..078f158 100644
--- a/criu/cr-dump.c
+++ b/criu/cr-dump.c
@@ -109,7 +109,7 @@ int collect_mappings(pid_t pid, struct vm_area_list *vma_area_list,
pr_info("Collecting mappings (pid: %d)\n", pid);
pr_info("----------------------------------------\n");
- ret = parse_smaps(pid, vma_area_list, dump_file);
+ ret = parse_smaps(pid, vma_area_list, (parse_filemap_t)dump_file);
if (ret < 0)
goto err;
diff --git a/criu/include/proc_parse.h b/criu/include/proc_parse.h
index 52ac92f..9837238 100644
--- a/criu/include/proc_parse.h
+++ b/criu/include/proc_parse.h
@@ -128,8 +128,9 @@ extern unsigned int parse_pid_loginuid(pid_t pid, int *err, bool ignore_noent);
extern int parse_pid_oom_score_adj(pid_t pid, int *err);
extern int prepare_loginuid(unsigned int value, unsigned int loglevel);
struct vma_area;
-typedef int (*dump_filemap_t)(struct vma_area *vma_area, int fd);
-extern int parse_smaps(pid_t pid, struct vm_area_list *vma_area_list, dump_filemap_t cb);
+
+typedef int (*parse_filemap_t)(struct vma_area *vma_area, int fd);
+extern int parse_smaps(pid_t pid, struct vm_area_list *vma_area_list, parse_filemap_t cb);
extern int parse_self_maps_lite(struct vm_area_list *vms);
extern int parse_pid_status(pid_t pid, struct proc_status_creds *);
diff --git a/criu/proc_parse.c b/criu/proc_parse.c
index 2d688a4..31f70e9 100644
--- a/criu/proc_parse.c
+++ b/criu/proc_parse.c
@@ -642,7 +642,7 @@ static int vma_list_add(struct vma_area *vma_area,
}
int parse_smaps(pid_t pid, struct vm_area_list *vma_area_list,
- dump_filemap_t dump_filemap)
+ parse_filemap_t parse_filemap)
{
struct vma_area *vma_area = NULL;
unsigned long start, end, pgoff, prev_end = 0;
@@ -747,7 +747,7 @@ int parse_smaps(pid_t pid, struct vm_area_list *vma_area_list,
if (vma_entry_is(vma_area->e, VMA_FILE_PRIVATE) ||
vma_entry_is(vma_area->e, VMA_FILE_SHARED)) {
- if (dump_filemap && dump_filemap(vma_area, vm_file_fd))
+ if (parse_filemap && parse_filemap(vma_area, vm_file_fd))
goto err;
}
}
More information about the CRIU
mailing list