Skip to content

Commit a35712a

Browse files
paulfertsernattgris
authored andcommitted
server: shutdown command should lead to exit without evaluating the rest
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]>
1 parent 25e7a69 commit a35712a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/server/server.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ COMMAND_HANDLER(handle_shutdown_command)
589589

590590
shutdown_openocd = 1;
591591

592-
return ERROR_OK;
592+
return ERROR_COMMAND_CLOSE_CONNECTION;
593593
}
594594

595595
COMMAND_HANDLER(handle_poll_period_command)

0 commit comments

Comments
 (0)