[CRIU] [PATCH 1/4] vma: don't define dump_filemap_t twice

Andrei Vagin avagin at openvz.org
Tue Aug 16 08:22:22 PDT 2016


From: Andrei Vagin <avagin at virtuozzo.com>

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.

Warning: proc_parse.h:131: note: previous declaration of ‘dump_filemap_t’ was here
Signed-off-by: Andrei Vagin <avagin at virtuozzo.com>
---
 criu/include/proc_parse.h | 4 ----
 criu/include/vma.h        | 3 +++
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/criu/include/proc_parse.h b/criu/include/proc_parse.h
index 52ac92f..4bc0ffa 100644
--- a/criu/include/proc_parse.h
+++ b/criu/include/proc_parse.h
@@ -127,10 +127,6 @@ extern int parse_pid_stat(pid_t pid, struct proc_pid_stat *s);
 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);
-extern int parse_self_maps_lite(struct vm_area_list *vms);
 extern int parse_pid_status(pid_t pid, struct proc_status_creds *);
 
 struct inotify_wd_entry {
diff --git a/criu/include/vma.h b/criu/include/vma.h
index 32201a8..88d4e2b 100644
--- a/criu/include/vma.h
+++ b/criu/include/vma.h
@@ -79,6 +79,9 @@ extern int collect_mappings(pid_t pid,
 		struct vm_area_list *vma_area_list, dump_filemap_t cb);
 extern void free_mappings(struct vm_area_list *vma_area_list);
 
+extern int parse_smaps(pid_t pid, struct vm_area_list *vma_area_list, dump_filemap_t cb);
+extern int parse_self_maps_lite(struct vm_area_list *vms);
+
 #define vma_area_is(vma_area, s)	vma_entry_is((vma_area)->e, s)
 #define vma_area_len(vma_area)		vma_entry_len((vma_area)->e)
 #define vma_entry_is(vma, s)		(((vma)->status & (s)) == (s))
-- 
2.7.4



More information about the CRIU mailing list