[CRIU] [PATCH 1/9] restore: allocate pstree items from a shared pool
Andrey Vagin
avagin at openvz.org
Thu Sep 12 09:24:33 EDT 2013
A pstree item will contain pid and state. Both these properties will be
determined after creating processes and will be used from the
controlling proces.
Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
pstree.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/pstree.c b/pstree.c
index ff077aa..bd9d8fd 100644
--- a/pstree.c
+++ b/pstree.c
@@ -134,7 +134,12 @@ struct pstree_item *__alloc_pstree_item(bool rst)
{
struct pstree_item *item;
- item = xzalloc(sizeof(*item) + (rst ? sizeof(item->rst[0]) : 0));
+ if (!rst)
+ item = xzalloc(sizeof(*item));
+ else {
+ item = shmalloc(sizeof(*item) + sizeof(item->rst[0]));
+ memset(item, 0, sizeof(*item) + sizeof(item->rst[0]));
+ }
if (!item)
return NULL;
--
1.8.3.1
More information about the CRIU
mailing list