[CRIU] [PATCH] pstree: Update max_pid with thread ids

Pavel Emelyanov xemul at parallels.com
Wed Oct 29 04:28:12 PDT 2014


When creating helpers, we need to make sure their
PIDs do not intersect with threads' IDs.

Signed-off-by: Pavel Emelyanov <xemul at parallels.com>

---

diff --git a/pstree.c b/pstree.c
index 5ea4283..a75d17a 100644
--- a/pstree.c
+++ b/pstree.c
@@ -415,6 +415,7 @@ static int read_pstree_image(void)
 		for (i = 0; i < e->n_threads; i++) {
 			pi->threads[i].real = -1;
 			pi->threads[i].virt = e->threads[i];
+			max_pid = max((int)e->threads[i], max_pid);
 		}
 
 		task_entries->nr_threads += e->n_threads;



More information about the CRIU mailing list