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 <laanwj@gmail.com>
pull/4232/head
Jeff Garzik 11 years ago committed by Wladimir J. van der Laan
parent 8615bfb486
commit 0cafb63025
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6

@ -65,17 +65,17 @@ int main(int argc, char* argv[])
try try
{ {
if(!AppInitRPC(argc, argv)) if(!AppInitRPC(argc, argv))
return abs(RPC_MISC_ERROR); return EXIT_FAILURE;
} }
catch (std::exception& e) { catch (std::exception& e) {
PrintExceptionContinue(&e, "AppInitRPC()"); PrintExceptionContinue(&e, "AppInitRPC()");
return abs(RPC_MISC_ERROR); return EXIT_FAILURE;
} catch (...) { } catch (...) {
PrintExceptionContinue(NULL, "AppInitRPC()"); PrintExceptionContinue(NULL, "AppInitRPC()");
return abs(RPC_MISC_ERROR); return EXIT_FAILURE;
} }
int ret = abs(RPC_MISC_ERROR); int ret = EXIT_FAILURE;
try try
{ {
ret = CommandLineRPC(argc, argv); ret = CommandLineRPC(argc, argv);

@ -234,7 +234,7 @@ int CommandLineRPC(int argc, char *argv[])
} }
catch (std::exception& e) { catch (std::exception& e) {
strPrint = string("error: ") + e.what(); strPrint = string("error: ") + e.what();
nRet = abs(RPC_MISC_ERROR); nRet = EXIT_FAILURE;
} }
catch (...) { catch (...) {
PrintExceptionContinue(NULL, "CommandLineRPC()"); PrintExceptionContinue(NULL, "CommandLineRPC()");

Loading…
Cancel
Save