[prev in list] [next in list] [prev in thread] [next in thread]
List: openvz-criu
Subject: [CRIU] [PATCH v3 04/10] files: Close old service fd in clone_service_fd()
From: Kirill Tkhai <ktkhai () virtuozzo ! com>
Date: 2017-12-29 9:35:45
Message-ID: 151454014516.19480.11496543085962367858.stgit () localhost ! localdomain
[Download RAW message or body]
Next patches will make service_fd_base not contant.
It will be "floating" and change from task to task.
This patch makes preparation for that: it closes
old service fd after it's duplicated.
Currently the code is unused as in case of
!(rsti(me)->clone_flags & CLONE_FILES), the child
has the same id as its parent, and the duplication
just does not occur.
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
criu/util.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/criu/util.c b/criu/util.c
index a8b7ef4ef..a1ce72f8b 100644
--- a/criu/util.c
+++ b/criu/util.c
@@ -545,6 +545,8 @@ int clone_service_fd(struct pstree_item *me)
continue;
pr_perror("Unable to clone %d->%d", old, new);
}
+ if (ret >= 0 && !(rsti(me)->clone_flags & CLONE_FILES))
+ close(old);
}
service_fd_id = id;
_______________________________________________
CRIU mailing list
CRIU@openvz.org
https://lists.openvz.org/mailman/listinfo/criu
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic