Merge branch 'ab/common-main-cleanup'

Code clean-up.

* ab/common-main-cleanup:
  common-main.c: call exit(), don't return
This commit is contained in:
Junio C Hamano 2021-12-22 22:48:11 -08:00
commit 67b7017593
2 changed files with 9 additions and 5 deletions

View File

@ -51,7 +51,10 @@ int main(int argc, const char **argv)
result = cmd_main(argc, argv); result = cmd_main(argc, argv);
trace2_cmd_exit(result); /*
* We define exit() to call trace2_cmd_exit_fl() in
return result; * git-compat-util.h. Whether we reach this or exit()
* elsewhere we'll always run our trace2 exit handler.
*/
exit(result);
} }

View File

@ -262,8 +262,9 @@ static int print_usage(void)
* [] the "cmd_name" event has been generated. * [] the "cmd_name" event has been generated.
* [] this writes various "def_param" events for interesting config values. * [] this writes various "def_param" events for interesting config values.
* *
* We further assume that if we return (rather than exit()), trace2_cmd_exit() * We return from here and let test-tool.c::cmd_main() pass the exit
* will be called by test-tool.c:cmd_main(). * code to common-main.c::main(), which will use it to call
* trace2_cmd_exit().
*/ */
int cmd__trace2(int argc, const char **argv) int cmd__trace2(int argc, const char **argv)
{ {