X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Fopenocd.c;h=78336068d586ba8aaab51ae8ee929233f84092ab;hb=edf52a6cc5314a1db34c110050090a539c8ab3ed;hp=e500ba6081a9182dbea9d91127e77ea28411e8f3;hpb=f3e6f584f12dbde9ba9806ed4a412db0524d438c;p=openocd.git diff --git a/src/openocd.c b/src/openocd.c index e500ba6081..78336068d5 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include @@ -62,7 +62,6 @@ COMMAND_HANDLER(handle_version_command) return ERROR_OK; } - static int log_target_callback_event_handler(struct target *target, enum target_event event, void *priv) { switch (event) @@ -203,7 +202,7 @@ struct command_context *setup_command_handler(Jim_Interp *interp) /* register subsystem commands */ typedef int (*command_registrant_t)(struct command_context *cmd_ctx); - command_registrant_t command_registrants[] = { + static const command_registrant_t command_registrants[] = { &openocd_register_commands, &server_register_commands, &gdb_register_commands, @@ -229,7 +228,8 @@ struct command_context *setup_command_handler(Jim_Interp *interp) } LOG_DEBUG("command registration: complete"); - LOG_OUTPUT(OPENOCD_VERSION "\n"); + LOG_OUTPUT(OPENOCD_VERSION "\n" + "Licensed under GNU GPL v2\n"); global_cmd_ctx = cmd_ctx; @@ -255,13 +255,15 @@ int openocd_main(int argc, char *argv[]) "http://openocd.berlios.de/doc/doxygen/bugs.html" "\n"); - command_context_mode(cmd_ctx, COMMAND_CONFIG); command_set_output_handler(cmd_ctx, configuration_output_handler, NULL); if (parse_cmdline_args(cmd_ctx, argc, argv) != ERROR_OK) return EXIT_FAILURE; + if (server_preinit() != ERROR_OK) + return EXIT_FAILURE; + ret = parse_config_file(cmd_ctx); if (ret != ERROR_OK) return EXIT_FAILURE;