[CRIU] [PATCH 1/2] restore: actually fail if clone() fails

Tycho Andersen tycho.andersen at canonical.com
Wed Aug 6 11:06:28 PDT 2014


Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
---
 cr-restore.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/cr-restore.c b/cr-restore.c
index 7569afa..88c4b95 100644
--- a/cr-restore.c
+++ b/cr-restore.c
@@ -982,8 +982,11 @@ static inline int fork_with_pid(struct pstree_item *item)
 	ret = clone(restore_task_with_children, ca.stack_ptr,
 			ca.clone_flags | SIGCHLD, &ca);
 
-	if (ret < 0)
+	if (ret < 0) {
 		pr_perror("Can't fork for %d", pid);
+		goto err_unlock;
+	}
+
 
 	if (item == root_item)
 		item->pid.real = ret;
-- 
1.9.1



More information about the CRIU mailing list