[5/5] criu: call kerndat_init() after log_init()

Submitted by Andrey Vagin on Sept. 12, 2018, 11:41 p.m.

Details

Message ID 20180912234115.20736-6-avagin@virtuozzo.com
State Accepted
Series "criu: remove all magic of service-fd when it isn't required"
Headers show

Commit Message

Andrey Vagin Sept. 12, 2018, 11:41 p.m.
We don't have rights to print anything into standard descriptors
and we want to have all output in a specified log file.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
---
 criu/cr-service.c | 3 +++
 criu/crtools.c    | 6 +++---
 2 files changed, 6 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/cr-service.c b/criu/cr-service.c
index 8b06f3bb8..dbeb1a881 100644
--- a/criu/cr-service.c
+++ b/criu/cr-service.c
@@ -371,6 +371,9 @@  static int setup_opts_from_req(int sk, CriuOpts *req)
 		goto err;
 	}
 
+	if (kerndat_init())
+		return 1;
+
 	if (log_keep_err()) {
 		pr_perror("Can't tune log");
 		goto err;
diff --git a/criu/crtools.c b/criu/crtools.c
index 8e98d1599..64d298de7 100644
--- a/criu/crtools.c
+++ b/criu/crtools.c
@@ -58,9 +58,6 @@  static int early_init(void)
 	if (init_service_fd())
 		return 1;
 
-	if (kerndat_init())
-		return 1;
-
 	return 0;
 }
 
@@ -214,6 +211,9 @@  int main(int argc, char *argv[], char *envp[])
 	if (log_init(opts.output))
 		return 1;
 
+	if (kerndat_init())
+		return 1;
+
 	if (opts.deprecated_ok)
 		pr_debug("DEPRECATED ON\n");