aboutsummaryrefslogtreecommitdiff
path: root/src/openocd.c
diff options
context:
space:
mode:
authorMarc Schink <openocd-dev@marcschink.de>2016-01-24 20:58:24 +0100
committerFreddie Chopin <freddie.chopin@gmail.com>2017-04-25 16:56:35 +0100
commitb43b95e46022d3baf76b44f7be34bbf0e6119594 (patch)
treef74666366f054f8ae4d6f45da4602c65111627e0 /src/openocd.c
parent99db18a995c8ef2913f1397dcc94d0533331e598 (diff)
downloadriscv-openocd-b43b95e46022d3baf76b44f7be34bbf0e6119594.zip
riscv-openocd-b43b95e46022d3baf76b44f7be34bbf0e6119594.tar.gz
riscv-openocd-b43b95e46022d3baf76b44f7be34bbf0e6119594.tar.bz2
server/server: Remove all exit() calls
With this patch OpenOCD shuts down properly when errors occur in the server instead of just calling exit(). Change-Id: I2ae1a6153dafc88667951cab9152941cb487be85 Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/3223 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
Diffstat (limited to 'src/openocd.c')
-rw-r--r--src/openocd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/openocd.c b/src/openocd.c
index 94fab3a..83329b5 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);