From a7199038042a79d24bce7e94a3984ad3e05be184 Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Mon, 24 Feb 2014 14:08:56 +0100 Subject: Fix bitcoin-cli exit status code --- src/bitcoin-cli.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/bitcoin-cli.cpp') diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 04b75e7f1..51a746f84 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -6,6 +6,7 @@ #include "util.h" #include "init.h" #include "rpcclient.h" +#include "rpcprotocol.h" #include "ui_interface.h" /* for _(...) */ #include "chainparams.h" @@ -55,23 +56,25 @@ int main(int argc, char* argv[]) try { if(!AppInitRPC(argc, argv)) - return 1; + return abs(RPC_MISC_ERROR); } catch (std::exception& e) { PrintExceptionContinue(&e, "AppInitRPC()"); + return abs(RPC_MISC_ERROR); } catch (...) { PrintExceptionContinue(NULL, "AppInitRPC()"); + return abs(RPC_MISC_ERROR); } + int ret = abs(RPC_MISC_ERROR); try { - if(!CommandLineRPC(argc, argv)) - return 1; + ret = CommandLineRPC(argc, argv); } catch (std::exception& e) { PrintExceptionContinue(&e, "CommandLineRPC()"); } catch (...) { PrintExceptionContinue(NULL, "CommandLineRPC()"); } - return 0; + return ret; } -- cgit v1.2.3