From aa51bf547d85352a5f384cf7a35f499792a757af Mon Sep 17 00:00:00 2001 From: kundatipradeep <35292742+kundatipradeep@users.noreply.github.com> Date: Tue, 14 Sep 2021 14:35:02 +0530 Subject: daemon: Call dlt_daemon_configuration_load() properly (#330) As init_p2 does the offline trace initialization, load configuration should be called prior, as LoggingMode is set through run-timeconfiguration file. With original logic it results in offline trace write failed, it is not valid trace directory errors. --- src/daemon/dlt-daemon.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/daemon/dlt-daemon.c b/src/daemon/dlt-daemon.c index ff959c4..350e594 100644 --- a/src/daemon/dlt-daemon.c +++ b/src/daemon/dlt-daemon.c @@ -970,6 +970,12 @@ int main(int argc, char *argv[]) dlt_log(LOG_ERR, "Could not load runtime config\n"); return -1; } + + /* + * Load dlt-runtime.cfg if available. + * This must be loaded before offline setup + */ + dlt_daemon_configuration_load(&daemon, daemon.runtime_configuration, daemon_local.flags.vflag); /* --- Daemon init phase 2 begin --- */ if (dlt_daemon_local_init_p2(&daemon, &daemon_local, daemon_local.flags.vflag) == -1) { @@ -979,12 +985,6 @@ int main(int argc, char *argv[]) /* --- Daemon init phase 2 end --- */ - /* - * Load dlt-runtime.cfg if available. - * This must be loaded before offline setup - */ - dlt_daemon_configuration_load(&daemon, daemon.runtime_configuration, daemon_local.flags.vflag); - if (daemon_local.flags.offlineLogstorageDirPath[0]) if (dlt_daemon_logstorage_setup_internal_storage( &daemon, -- cgit v1.2.1