Skip to content

Commit

Permalink
Addressed more code review
Browse files Browse the repository at this point in the history
Signed-off-by: Leanid Astrakou <lastrakou@rocketsoftware.com>
  • Loading branch information
DivergentEuropeans committed Aug 28, 2023
1 parent 74b0811 commit 961ab57
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1620,13 +1620,15 @@ int main(int argc, char **argv) {
}

INFO(MSG_LAUNCHER_START);
wtoPrintf3(MSG_LAUNCHER_START); // Manual sys log print (messages not set here yet)

zl_config_t config = read_config(argc, argv);
zl_context.config = config;

LoggingContext *logContext = makeLoggingContext();
if (!logContext) {
ERROR(MSG_NO_LOG_CONTEXT);
wtoPrintf3(MSG_NO_LOG_CONTEXT); // Manual sys log print (messages not set here yet)
exit(EXIT_FAILURE);
}
logConfigureStandardDestinations(logContext);
Expand All @@ -1637,6 +1639,7 @@ int main(int argc, char **argv) {
cfgSetTraceLevel(configmgr, zl_context.config.debug_mode ? 2 : 0);
if (init_context(argc, argv, &config, configmgr)) {
ERROR(MSG_CTX_INIT_FAILED);
wtoPrintf3(MSG_CTX_INIT_FAILED); // Manual sys log print (messages not set here yet)
exit(EXIT_FAILURE);
}

Expand All @@ -1648,20 +1651,20 @@ int main(int argc, char **argv) {

if (cfgLoadConfiguration(configmgr, ZOWE_CONFIG_NAME) != 0){
ERROR(MSG_CFG_LOAD_FAIL);
wtoPrintf3(MSG_CFG_LOAD_FAIL); // Manual sys log print (messages not set here yet)
exit(EXIT_FAILURE);
}

if (setup_signal_handlers()) {
ERROR(MSG_SIGNAL_ERR);
wtoPrintf3(MSG_SIGNAL_ERR); // Manual sys log print (messages not set here yet)
exit(EXIT_FAILURE);
}

if (process_root_dir(configmgr)) {
exit(EXIT_FAILURE);
}

/* TODO(?): sys_messages could be set earlier than this w/ known sysMessages w/o having
config manager available to check zowe.yaml? */
set_sys_messages(configmgr);

//got root dir, can now load up the schemas from it
Expand Down

0 comments on commit 961ab57

Please sign in to comment.