-
Notifications
You must be signed in to change notification settings - Fork 38.7k
util: improve bitcoin-wallet exit codes #24428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Adjust the exit codes / functionality of bitcoin-wallet such that it's not returning a non-zero exit code if there isn't a problem. This is a followup from bitcoin#24263, and should allow us to add and additional check=True to our gen-manpages.py script.
Now that bitcoin-wallet no-longer returns a non-zero exit code when it shouldn't do, we can add check=True to our subprocess call. Follows up to the comments in bitcoin#24263 (comment).
394fdcc to
dd532ee
Compare
| } | ||
|
|
||
| static bool WalletAppInit(ArgsManager& args, int argc, char* argv[]) | ||
| static int WalletAppInit(ArgsManager& args, int argc, char* argv[]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could maybe make this option<int>, a categorical difference seems slightly neater to me than reserving a return code for continuing execution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Especially since EXIT_SUCCESS and EXIT_FAILURE are not guaranteed to be non--1 :)
|
Concept ACK |
1 similar comment
|
Concept ACK |
| if (ret != CONTINUE_EXECUTION) { | ||
| return ret; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it'd be better to just have WalletAppInit call exit(2) directly?
|
Concept ACK |
|
Alternative in #26067 using |
Refactors
bitcoin-walletso that it doesn't return a non-zero exit code by default, and makes the option handling more inline with the other binaries. i.e outputtingError: too few parametersif you don't pass any options.Fixing this means we can check the process output in
gen-manpages.py; which addresses the remaining review comment from #24263.