[CRIU] [PATCH 3/3] crtools: fix exit code for page-server

Andrei Vagin avagin at openvz.org
Mon Jan 23 14:57:43 PST 2017


From: Andrei Vagin <avagin at virtuozzo.com>

cr_page_server() returns pid, if it is executed as a daemon
otherwise it returns an error code.

crtools returns 0 only if cr_page_server() returns a positive value,
what is obviously wrong.

Signed-off-by: Andrei Vagin <avagin at virtuozzo.com>
---
 criu/crtools.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/criu/crtools.c b/criu/crtools.c
index 3123c36..cce8073 100644
--- a/criu/crtools.c
+++ b/criu/crtools.c
@@ -790,7 +790,7 @@ int main(int argc, char *argv[], char *envp[])
 #endif
 
 	if (!strcmp(argv[optind], "page-server"))
-		return cr_page_server(opts.daemon_mode, false, -1) > 0 ? 0 : 1;
+		return cr_page_server(opts.daemon_mode, false, -1) != 0;
 
 	if (!strcmp(argv[optind], "service"))
 		return cr_service(opts.daemon_mode);
-- 
2.7.4



More information about the CRIU mailing list