[CRIU] [PATCH 08/11] pstree: enable sid handling back
Pavel Tikhomirov
ptikhomirov at virtuozzo.com
Fri May 26 10:02:51 PDT 2017
FIXME disable pgid, as it does not work yet
Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
---
criu/cr-restore.c | 2 --
criu/pstree.c | 9 +++------
2 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/criu/cr-restore.c b/criu/cr-restore.c
index 05f24fe..1f62ac2 100644
--- a/criu/cr-restore.c
+++ b/criu/cr-restore.c
@@ -1477,8 +1477,6 @@ static void restore_sid(void)
{
pid_t sid;
- if (!list_empty(&top_pid_ns->children))
- return;
/*
* SID can only be reset to pid or inherited from parent.
* Thus we restore it right here to let our kids inherit
diff --git a/criu/pstree.c b/criu/pstree.c
index b36210d..9141289 100644
--- a/criu/pstree.c
+++ b/criu/pstree.c
@@ -1060,9 +1060,6 @@ static int prepare_pstree_ids(void)
struct pstree_item *item, *helper;
pid_t current_pgid = getpgid(getpid());
- if (!list_empty(&top_pid_ns->children))
- return 0;
-
/*
* Some task can be reparented to init. A helper task should be added
* for restoring sid of such tasks. The helper tasks will be exited
@@ -1119,6 +1116,9 @@ static int prepare_pstree_ids(void)
}
}
+ if (!list_empty(&top_pid_ns->children))
+ return 0;
+
/* Add a process group leader if it is absent */
for_each_pstree_item(item) {
struct pid *pid;
@@ -1369,9 +1369,6 @@ bool restore_before_setsid(struct pstree_item *child)
{
int csid = child->born_sid == -1 ? vsid(child) : child->born_sid;
- if (!list_empty(&top_pid_ns->children))
- return false;
-
if (child->parent->born_sid == csid)
return true;
--
2.9.3
More information about the CRIU
mailing list