summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
9ce207a)
openocd -f board/sheevaplug.cfg -c init -c exit
the calling shell will believe that openocd exited with an error due to exitval will be non-zero
This is not tested against incomming telnet
Change-Id: I63d15715a7b46f39a7de261a45039f8c3cad7a98
Signed-off-by: Stian Skjelstad <stian@nixia.no>
Reviewed-on: http://openocd.zylin.com/470
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Bill Traynor <wmat@alphatroop.com>
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
static int command_retval_set(Jim_Interp *interp, int retval)
{
int *return_retval = Jim_GetAssocData(interp, "retval");
static int command_retval_set(Jim_Interp *interp, int retval)
{
int *return_retval = Jim_GetAssocData(interp, "retval");
- if (return_retval != NULL)
- *return_retval = retval;
-
- return (retval == ERROR_OK) ? JIM_OK : JIM_ERR;
+ if (retval == ERROR_COMMAND_CLOSE_CONNECTION) {
+ if (return_retval != NULL)
+ *return_retval = 0;
+ return JIM_EXIT;
+ } else {
+ if (return_retval != NULL)
+ *return_retval = retval;
+ return (retval == ERROR_OK) ? JIM_OK : JIM_ERR;
+ }
}
extern struct command_context *global_cmd_ctx;
}
extern struct command_context *global_cmd_ctx;
}
return retval;
} else if (retcode == JIM_EXIT) {
}
return retval;
} else if (retcode == JIM_EXIT) {
- /* ignore.
- * exit(Jim_GetExitCode(interp)); */
} else {
const char *result;
int reslen;
} else {
const char *result;
int reslen;
* make no assumptions about what went wrong and try to handle the problem.
*/
#define ERROR_FAIL (-4)
* make no assumptions about what went wrong and try to handle the problem.
*/
#define ERROR_FAIL (-4)
+#define ERROR_OK_EXIT (-5)
return EXIT_FAILURE;
ret = parse_config_file(cmd_ctx);
return EXIT_FAILURE;
ret = parse_config_file(cmd_ctx);
+ if (ret == ERROR_OK_EXIT)
+ return ERROR_OK;
if (ret != ERROR_OK)
return EXIT_FAILURE;
if (ret != ERROR_OK)
return EXIT_FAILURE;