From 0cafb630254c6459ea02f6fc47e1c37bb81a1238 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Thu, 12 Jun 2014 22:26:46 -0400 Subject: [PATCH] bitcoin-cli, rpcclient: prefer EXIT_FAILURE cstdlib constant A more complex construction via abs() yields the same end result. Rebased-From: 34ff109 Rebased-By: Wladimir J. van der Laan --- src/bitcoin-cli.cpp | 8 ++++---- src/rpcclient.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 0bb71329f..0c7d6fe5a 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -65,17 +65,17 @@ int main(int argc, char* argv[]) try { if(!AppInitRPC(argc, argv)) - return abs(RPC_MISC_ERROR); + return EXIT_FAILURE; } catch (std::exception& e) { PrintExceptionContinue(&e, "AppInitRPC()"); - return abs(RPC_MISC_ERROR); + return EXIT_FAILURE; } catch (...) { PrintExceptionContinue(NULL, "AppInitRPC()"); - return abs(RPC_MISC_ERROR); + return EXIT_FAILURE; } - int ret = abs(RPC_MISC_ERROR); + int ret = EXIT_FAILURE; try { ret = CommandLineRPC(argc, argv); diff --git a/src/rpcclient.cpp b/src/rpcclient.cpp index b89a95ad1..1a5b3f741 100644 --- a/src/rpcclient.cpp +++ b/src/rpcclient.cpp @@ -234,7 +234,7 @@ int CommandLineRPC(int argc, char *argv[]) } catch (std::exception& e) { strPrint = string("error: ") + e.what(); - nRet = abs(RPC_MISC_ERROR); + nRet = EXIT_FAILURE; } catch (...) { PrintExceptionContinue(NULL, "CommandLineRPC()");