[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openocd-development
Subject:    [OpenOCD-devel] [PATCH]: 07f5fe0 Revert "When calling openocd from a shell like this:"
From:       gerrit () openocd ! zylin ! com
Date:       2012-07-20 12:58:15
Message-ID: 20120720125815.A82052408B () openocd ! zylin ! com
[Download RAW message or body]

This is an automated email from Gerrit.

Alex Austin (alex.austin@spectrumdsi.com) just uploaded a new patch set to Gerrit, \
which you can find at http://openocd.zylin.com/757

-- gerrit

commit 07f5fe0dda9c24abe53628da986bfda0e406bb4a
Author: Alex Austin <alex.austin@spectrumdsi.com>
Date:   Fri Jul 20 12:58:14 2012 +0000

    Revert "When calling openocd from a shell like this:"
    
    This reverts commit e8641695c634109ebf5f1149923971770da1d28a
    
    Original premise was wrong. Proper command is "shutdown", not "exit".

diff --git a/src/helper/command.c b/src/helper/command.c
index 868d095..ef0afa2 100644
--- a/src/helper/command.c
+++ b/src/helper/command.c
@@ -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;
diff --git a/src/helper/log.h b/src/helper/log.h
index ad8d247..e161a6e 100644
--- a/src/helper/log.h
+++ b/src/helper/log.h
@@ -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 */
diff --git a/src/openocd.c b/src/openocd.c
index d06e2c5..048ce85 100644
--- a/src/openocd.c
+++ b/src/openocd.c
@@ -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;
 

-- 

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic