[CRIU] [PATCH 3/3] options: Use union for @daemon and @restore_detach

Cyrill Gorcunov gorcunov at openvz.org
Fri Apr 3 08:03:47 PDT 2015


They both are using 'd' option in different context
though, lets give them two names.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 crtools.c            | 4 ++--
 include/cr_options.h | 5 ++++-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/crtools.c b/crtools.c
index a25223555876..331d3787ebf0 100644
--- a/crtools.c
+++ b/crtools.c
@@ -553,10 +553,10 @@ int main(int argc, char *argv[], char *envp[])
 	}
 
 	if (!strcmp(argv[optind], "page-server"))
-		return cr_page_server(opts.restore_detach, -1) > 0 ? 0 : 1;
+		return cr_page_server(opts.daemon_mode, -1) > 0 ? 0 : 1;
 
 	if (!strcmp(argv[optind], "service"))
-		return cr_service(opts.restore_detach);
+		return cr_service(opts.daemon_mode);
 
 	if (!strcmp(argv[optind], "dedup"))
 		return cr_dedup() != 0;
diff --git a/include/cr_options.h b/include/cr_options.h
index d6ce2ae4d1f2..27102b7e42fb 100644
--- a/include/cr_options.h
+++ b/include/cr_options.h
@@ -27,7 +27,10 @@ struct cr_options {
 	char			*show_fmt;
 	bool			check_ms_kernel;
 	bool			show_pages_content;
-	bool			restore_detach;
+	union {
+		bool		restore_detach;
+		bool		daemon_mode;
+	};
 	bool			restore_sibling;
 	bool			ext_unix_sk;
 	bool			shell_job;
-- 
1.9.3



More information about the CRIU mailing list