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

List:       openocd-development
Subject:    [PATCH]: 8489e64ba3 server: export shutdown_openocd variable
From:       gerrit () openocd ! org
Date:       2022-08-25 12:55:23
Message-ID: 20220825125523.3457AD5 () openocd ! org
[Download RAW message or body]

This is an automated email from Gerrit.

"Erhan Kurubas <erhan.kurubas@espressif.com>" just uploaded a new patch set to \
Gerrit, which you can find at https://review.openocd.org/c/openocd/+/7142

-- gerrit

commit 8489e64ba3bcc7d02dbddef661b23fd1c11b4593
Author: Erhan Kurubas <erhan.kurubas@espressif.com>
Date:   Thu Aug 25 15:41:52 2022 +0300

    server: export shutdown_openocd variable
    
    In the app-trace module we are polling the target in the while loops
    outside of the server.c
    In that loops, we need to catch ctrl+c signal by checking shutdown_openocd
    variable.
    
    Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com>
    Change-Id: Id87c709a01470bf6d3642078b160a68ca85f4406

diff --git a/src/server/server.c b/src/server/server.c
index eeaa3d750e..31c6256d0d 100644
--- a/src/server/server.c
+++ b/src/server/server.c
@@ -36,13 +36,7 @@
 
 static struct service *services;
 
-enum shutdown_reason {
-	CONTINUE_MAIN_LOOP,			/* stay in main event loop */
-	SHUTDOWN_REQUESTED,			/* set by shutdown command; exit the event loop and quit the \
                debugger */
-	SHUTDOWN_WITH_ERROR_CODE,	/* set by shutdown command; quit with non-zero return \
                code */
-	SHUTDOWN_WITH_SIGNAL_CODE	/* set by sig_handler; exec shutdown then exit with \
                signal as return code */
-};
-static enum shutdown_reason shutdown_openocd = CONTINUE_MAIN_LOOP;
+enum shutdown_reason shutdown_openocd = CONTINUE_MAIN_LOOP;
 
 /* store received signal to exit application by killing ourselves */
 static int last_signal;
diff --git a/src/server/server.h b/src/server/server.h
index f09988a8a0..dabcfead8c 100644
--- a/src/server/server.h
+++ b/src/server/server.h
@@ -25,6 +25,15 @@
 #include <netinet/in.h>
 #endif
 
+enum shutdown_reason {
+	CONTINUE_MAIN_LOOP,         /* stay in main event loop */
+	SHUTDOWN_REQUESTED,         /* set by shutdown command; exit the event loop and \
quit the debugger */ +	SHUTDOWN_WITH_ERROR_CODE,   /* set by shutdown command; quit \
with non-zero return code */ +	SHUTDOWN_WITH_SIGNAL_CODE   /* set by sig_handler; \
exec shutdown then exit with signal as return code */ +};
+
+extern enum shutdown_reason shutdown_openocd;
+
 enum connection_type {
 	CONNECTION_TCP,
 	CONNECTION_PIPE,

-- 


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

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