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:
Gustavo Henrique Nihei 2021-07-08 13:57:57 -03:00 committed by Xiang Xiao
parent 48ab08c43d
commit d12619c85f

View File

@ -206,7 +206,8 @@ int nx_vsyslog(int priority, FAR const IPTR char *fmt, FAR va_list *ap)
/* Prepend the process name */
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
/* Generate the output */