[CRIU] [PATCH] cr-service.c: rm extra error messages

Kir Kolyshkin kir at openvz.org
Wed Feb 5 08:54:19 PST 2014


setup_opts_from_req() prints an error message, so there's no need
for its caller to print another one.

While at it, simplify/unify error checking, treating any
non-zero value as an error.

Signed-off-by: Kir Kolyshkin <kir at openvz.org>
---
 cr-service.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/cr-service.c b/cr-service.c
index 5f7f712..99db4f0 100644
--- a/cr-service.c
+++ b/cr-service.c
@@ -260,10 +260,8 @@ static int dump_using_req(int sk, CriuOpts *req)
 	bool success = false;
 	bool self_dump = !req->pid;
 
-	if (setup_opts_from_req(sk, req) == -1) {
-		pr_perror("Arguments treating fail");
+	if (setup_opts_from_req(sk, req))
 		goto exit;
-	}
 
 	/*
 	 * FIXME -- cr_dump_tasks() may return code from custom
@@ -298,10 +296,8 @@ static int restore_using_req(int sk, CriuOpts *req)
 
 	opts.restore_detach = true;
 
-	if (setup_opts_from_req(sk, req) == -1) {
-		pr_perror("Arguments treating fail");
+	if (setup_opts_from_req(sk, req))
 		goto exit;
-	}
 
 	if (cr_restore_tasks())
 		goto exit;
@@ -346,10 +342,8 @@ static int pre_dump_using_req(int sk, CriuOpts *opts)
 	if (pid == 0) {
 		int ret = 1;
 
-		if (setup_opts_from_req(sk, opts)) {
-			pr_perror("Bad options");
+		if (setup_opts_from_req(sk, opts))
 			goto cout;
-		}
 
 		if (cr_pre_dump_tasks(opts->pid))
 			goto cout;
-- 
1.8.1.4



More information about the CRIU mailing list