mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
sched/backtrace: simplify the assign of tcb in case of negative pid
Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
committed by
Gustavo Henrique Nihei
parent
e092c457e6
commit
904348302a
@@ -42,21 +42,16 @@
|
||||
|
||||
int sched_backtrace(pid_t tid, FAR void **buffer, int size)
|
||||
{
|
||||
FAR struct tcb_s *rtcb;
|
||||
FAR struct tcb_s *rtcb = NULL;
|
||||
|
||||
if (tid < 0)
|
||||
{
|
||||
rtcb = running_task();
|
||||
}
|
||||
else
|
||||
if (tid >= 0)
|
||||
{
|
||||
rtcb = nxsched_get_tcb(tid);
|
||||
}
|
||||
|
||||
if (rtcb == NULL)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return up_backtrace(rtcb, buffer, size);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user