mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 19:36:35 +08:00
drivers/syslog: Avoid prepending process name when no TCB is available
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
This commit is contained in:
committed by
Xiang Xiao
parent
48ab08c43d
commit
d12619c85f
@@ -206,7 +206,8 @@ int nx_vsyslog(int priority, FAR const IPTR char *fmt, FAR va_list *ap)
|
|||||||
/* Prepend the process name */
|
/* Prepend the process name */
|
||||||
|
|
||||||
tcb = nxsched_get_tcb(getpid());
|
tcb = nxsched_get_tcb(getpid());
|
||||||
ret += lib_sprintf(&stream.public, "%s: ", tcb->name);
|
ret += lib_sprintf(&stream.public, "%s: ",
|
||||||
|
(tcb != NULL) ? tcb->name : "(null)");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Generate the output */
|
/* Generate the output */
|
||||||
|
|||||||
Reference in New Issue
Block a user