[CRIU] [PATCH] action-scripts: set CRTOOL_INIT_PID only if pid is valid

Stanislav Kinsburskiy skinsbursky at virtuozzo.com
Wed May 4 03:53:21 PDT 2016


Otherwise is will become equal to "-1".

Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
---
 criu/action-scripts.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/criu/action-scripts.c b/criu/action-scripts.c
index ee59210..6a901d5 100644
--- a/criu/action-scripts.c
+++ b/criu/action-scripts.c
@@ -63,7 +63,7 @@ static int run_shell_scripts(const char *action)
 		env_set |= ENV_IMGDIR;
 	}
 
-	if (!(env_set & ENV_ROOTPID) && root_item) {
+	if (!(env_set & ENV_ROOTPID) && root_item && (root_item->pid.real != -1)) {
 		int pid;
 		char root_item_pid[16];
 



More information about the CRIU mailing list