X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Fopenocd.c;h=831bd17f2a64282b99c9920f00af8a9e44cc680f;hb=bb9d9c60264a905926e0d15f84842858d0de80b7;hp=94fab3a94e891ab5e9596325e6437a46e068207f;hpb=3a4af874874ad623553ac061a771d428bce1e814;p=openocd.git diff --git a/src/openocd.c b/src/openocd.c index 94fab3a94e..831bd17f2a 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -297,8 +297,10 @@ static int openocd_thread(int argc, char *argv[], struct command_context *cmd_ct if (init_at_startup) { ret = command_run_line(cmd_ctx, "init"); - if (ERROR_OK != ret) + if (ERROR_OK != ret) { + server_quit(); return ERROR_FAIL; + } } ret = server_loop(cmd_ctx); @@ -342,8 +344,8 @@ int openocd_main(int argc, char *argv[]) unregister_all_commands(cmd_ctx, NULL); - /* free commandline interface */ - command_done(cmd_ctx); + /* Shutdown commandline interface */ + command_exit(cmd_ctx); adapter_quit();