Skip to content

Commit

Permalink
server: shutdown command should lead to exit without evaluating the rest
Browse files Browse the repository at this point in the history
Currently

openocd -c "echo a1; shutdown; echo a2"

outputs both "a1" and "a2" and only then shuts down. This patch fixes
it by making shutdown command throw an exception, so unless it's
caught the shutdown will behave as expected.

Change-Id: I764268b3a9046ff3e9717d04095ea0673f1d755a
Signed-off-by: Paul Fertser <[email protected]>
Reviewed-on: http://openocd.zylin.com/2511
Tested-by: jenkins
Reviewed-by: Uwe Bonnes <[email protected]>
Reviewed-by: Spencer Oliver <[email protected]>
  • Loading branch information
paulfertser authored and nattgris committed Feb 11, 2015
1 parent 25e7a69 commit a35712a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/server/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ COMMAND_HANDLER(handle_shutdown_command)

shutdown_openocd = 1;

return ERROR_OK;
return ERROR_COMMAND_CLOSE_CONNECTION;
}

COMMAND_HANDLER(handle_poll_period_command)
Expand Down

0 comments on commit a35712a

Please sign in to comment.