[CRIU] [PATCH 1/2] ns: Concretize error reporting in prepare_net_namespaces()
Kirill Tkhai
ktkhai at virtuozzo.com
Wed Mar 22 03:25:58 PDT 2017
Show more clear, which problem happened: either waitpid() failed
or wrong status was received.
Reported-by: Andrew Vagin <avagin at virtuozzo.com>
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
criu/net.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/criu/net.c b/criu/net.c
index 45f6fcee0..ae07ff247 100644
--- a/criu/net.c
+++ b/criu/net.c
@@ -1785,8 +1785,9 @@ int prepare_net_namespaces()
pr_perror("Can't clone");
goto err;
}
+ errno = 0;
if (waitpid(pid, &status, 0) != pid || !WIFEXITED(status) || WEXITSTATUS(status)) {
- pr_perror("Child process waiting %d", status);
+ pr_err("Child waiting: errno=%d, status=%d\n", errno, status);
goto err;
}
} else {
More information about the CRIU
mailing list