]> git.sur5r.net Git - openocd/commitdiff
Revert "When calling openocd from a shell like this:"
authorAlex Austin <alex.austin@spectrumdsi.com>
Fri, 20 Jul 2012 12:58:14 +0000 (12:58 +0000)
committerPeter Stuge <peter@stuge.se>
Sun, 22 Jul 2012 19:18:22 +0000 (19:18 +0000)
This reverts commit e8641695c634109ebf5f1149923971770da1d28a

Original premise was wrong. Proper command is "shutdown", not "exit".

Change-Id: I07f5fe0dda9c24abe53628da986bfda0e406bb4a
Signed-off-by: Alex Austin <alex.austin@spectrumdsi.com>
Reviewed-on: http://openocd.zylin.com/757
Tested-by: jenkins
Reviewed-by: Peter Stuge <peter@stuge.se>
src/helper/command.c
src/helper/log.h
src/openocd.c

index 868d0952ece6911ca18a69c20bab9737b714d98e..ef0afa2b56bca06e5b88e13ce4c5ca2c97b4ec2b 100644 (file)
@@ -118,15 +118,10 @@ static void command_log_capture_finish(struct log_capture_state *state)
 static int command_retval_set(Jim_Interp *interp, int retval)
 {
        int *return_retval = Jim_GetAssocData(interp, "retval");
-       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;
-       }
+       if (return_retval != NULL)
+               *return_retval = retval;
+
+       return (retval == ERROR_OK) ? JIM_OK : JIM_ERR;
 }
 
 extern struct command_context *global_cmd_ctx;
@@ -676,7 +671,8 @@ int command_run_line(struct command_context *context, char *line)
                }
                return retval;
        } else if (retcode == JIM_EXIT) {
-               return ERROR_OK_EXIT;
+               /* ignore.
+                * exit(Jim_GetExitCode(interp)); */
        } else {
                const char *result;
                int reslen;
index ad8d24795d434387d4e876a979f3c28701d5be30..e161a6ea2b00b66d1b36143ea9c711f946a18c2b 100644 (file)
@@ -138,5 +138,5 @@ extern int debug_level;
  * make no assumptions about what went wrong and try to handle the problem.
  */
 #define ERROR_FAIL                                             (-4)
-#define ERROR_OK_EXIT                                  (-5)
+
 #endif /* LOG_H */
index d06e2c56e5258a09d09cad9f794794defaaf8a43..048ce8524809e319579a68f163cec12bdb829b0e 100644 (file)
@@ -279,8 +279,6 @@ static int openocd_thread(int argc, char *argv[], struct command_context *cmd_ct
                return EXIT_FAILURE;
 
        ret = parse_config_file(cmd_ctx);
-       if (ret == ERROR_OK_EXIT)
-               return ERROR_OK;
        if (ret != ERROR_OK)
                return EXIT_FAILURE;