From 956629c5a9f32dbfeca1d03e87bc753fda3d3456 Mon Sep 17 00:00:00 2001 From: "pradeep.ns" Date: Fri, 2 Jun 2017 13:17:11 +0530 Subject: [PATCH] Set stkmon_started=FALSE in error case pthread_cancel kills the thread and stkmon logging will be stopped immediately. hence set the variable stkmon_started to FALSE so that user can re-attempt command "stkmon" from tash Signed-off-by: pradeep.ns --- apps/system/utils/kdbg_stackmonitor.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/system/utils/kdbg_stackmonitor.c b/apps/system/utils/kdbg_stackmonitor.c index e01e9ab..7bdae89 100644 --- a/apps/system/utils/kdbg_stackmonitor.c +++ b/apps/system/utils/kdbg_stackmonitor.c @@ -272,6 +272,8 @@ int kdbg_stackmonitor(int argc, char **args) if (ret != OK) { printf(STKMON_PREFIX "ERROR: Failed to detach the stack monitor: %d\n", errno); pthread_cancel(stkmon); + stkmon_started = FALSE; + return ERROR; } } else { printf(STKMON_PREFIX "already started\n"); -- 2.7.4