This is an automated email from the ASF dual-hosted git repository.
xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
The following commit(s) were added to refs/heads/master by this push:
new c85eed67c examples/nxmbserver: Reset g_running on every run.
c85eed67c is described below
commit c85eed67ce2c76b1306275790d041ccc7d331b1c
Author: raiden00pl <[email protected]>
AuthorDate: Sat Oct 10 15:20:49 2026 +0200
examples/nxmbserver: Reset g_running on every run.
g_running was initialized to true only at load time and the signal
handler sets it to false. NuttX does not re-initialize .data between
runs of a builtin, so after one SIGINT/SIGTERM every later nxmbserver
run in the same boot left the poll loop at once. Set g_running before
connecting the signal handlers.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: raiden00pl <[email protected]>
---
examples/nxmbserver/nxmbserver_main.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/examples/nxmbserver/nxmbserver_main.c
b/examples/nxmbserver/nxmbserver_main.c
index 8e8572dda..1dfe376e1 100644
--- a/examples/nxmbserver/nxmbserver_main.c
+++ b/examples/nxmbserver/nxmbserver_main.c
@@ -439,8 +439,11 @@ int main(int argc, FAR char *argv[])
return EXIT_FAILURE;
}
- /* Connect signals */
+ /* Connect signals. g_running is not re-initialized between runs of a
+ * builtin, so set it here.
+ */
+ g_running = true;
signal(SIGINT, signal_handler);
signal(SIGTERM, signal_handler);