[CRIU] [PATCH] dump: Don't shadow the ret code with dump_namespaces

Cyrill Gorcunov gorcunov at openvz.org
Tue Mar 13 10:11:46 EDT 2012


cr_dump_tasks does assign ret = -1 by default but
dump_namespaces does shadow this variable with own
error code so that if any subsequent calls will fail
we will not notice the error.

Reported-by: Andrew Vagin <avagin at openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 cr-dump.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/cr-dump.c b/cr-dump.c
index 6c71c84..de7310d 100644
--- a/cr-dump.c
+++ b/cr-dump.c
@@ -1420,8 +1420,7 @@ int cr_dump_tasks(pid_t pid, const struct cr_options *opts)
 		goto err;
 
 	if (opts->namespaces_flags) {
-		ret = dump_namespaces(pid, opts->namespaces_flags);
-		if (ret < 0)
+		if (dump_namespaces(pid, opts->namespaces_flags) < 0)
 			goto err;
 	}
 
-- 
1.7.7.6



More information about the CRIU mailing list