From caa01ca443a78a6d3b4800cc2f2ea8081d4236d1 Mon Sep 17 00:00:00 2001 From: greg7mdp Date: Sat, 25 Feb 2023 14:39:25 -0500 Subject: [PATCH] `main()` should return if appbase initialization fails. --- programs/keosd/main.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/programs/keosd/main.cpp b/programs/keosd/main.cpp index 15893cd3bb..c4a7327eb3 100644 --- a/programs/keosd/main.cpp +++ b/programs/keosd/main.cpp @@ -71,6 +71,17 @@ bfs::path determine_home_directory() return home; } +enum return_codes { + OTHER_FAIL = -2, + INITIALIZE_FAIL = -1, + SUCCESS = 0, + BAD_ALLOC = 1, + DATABASE_DIRTY = 2, + FIXED_REVERSIBLE = SUCCESS, + EXTRACTED_GENESIS = SUCCESS, + NODE_MANAGEMENT_SUCCESS = 5 +}; + int main(int argc, char** argv) { try { @@ -90,6 +101,7 @@ int main(int argc, char** argv) opts.count("print-default-config")) { return 0; } + return INITIALIZE_FAIL; } initialize_logging(); auto& http = app().get_plugin();