[CRIU] [PATCH 05/16] mem/vma: Use memset for vm_area_list_init
Cyrill Gorcunov
gorcunov at gmail.com
Fri Jul 5 18:38:00 MSK 2019
To eliminate side effects, in particular setting nr_aios
is already missing here.
Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
---
criu/include/vma.h | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/criu/include/vma.h b/criu/include/vma.h
index c297c0d141a0..6f5ee19d3888 100644
--- a/criu/include/vma.h
+++ b/criu/include/vma.h
@@ -7,6 +7,7 @@
#include "images/vma.pb-c.h"
#include <sys/mman.h>
+#include <string.h>
struct vm_area_list {
struct list_head h;
@@ -21,11 +22,8 @@ struct vm_area_list {
static inline void vm_area_list_init(struct vm_area_list *vml)
{
+ memset(vml, 0, sizeof(*vml));
INIT_LIST_HEAD(&vml->h);
- vml->nr = 0;
- vml->priv_size = 0;
- vml->priv_longest = 0;
- vml->shared_longest = 0;
}
struct file_desc;
--
2.20.1
More information about the CRIU
mailing list