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,20 +42,15 @@
|
|||||||
|
|
||||||
int sched_backtrace(pid_t tid, FAR void **buffer, int size)
|
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)
|
if (tid >= 0)
|
||||||
{
|
|
||||||
rtcb = running_task();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
rtcb = nxsched_get_tcb(tid);
|
rtcb = nxsched_get_tcb(tid);
|
||||||
}
|
if (rtcb == NULL)
|
||||||
|
{
|
||||||
if (rtcb == NULL)
|
return 0;
|
||||||
{
|
}
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return up_backtrace(rtcb, buffer, size);
|
return up_backtrace(rtcb, buffer, size);
|
||||||
|
|||||||
Reference in New Issue
Block a user