drivers/syslog/vsyslog.c: nx_syslog's return value should include the timestamp length

This commit is contained in:
Xiang Xiao 2018-11-09 08:35:20 -06:00 committed by Gregory Nutt
parent 2e18b603ad
commit 0f940e06f5
1 changed files with 4 additions and 4 deletions

View File

@ -131,16 +131,16 @@ int nx_vsyslog(int priority, FAR const IPTR char *fmt, FAR va_list *ap)
#if defined(CONFIG_SYSLOG_TIMESTAMP)
/* Pre-pend the message with the current time, if available */
(void)lib_sprintf(&stream.public, "[%5d.%06d] ",
ret = lib_sprintf(&stream.public, "[%5d.%06d] ",
ts.tv_sec, ts.tv_nsec/1000);
#else
ret = 0;
#endif
#if defined(CONFIG_SYSLOG_PREFIX)
/* Pre-pend the prefix, if available */
ret = lib_sprintf(&stream.public, "%s", CONFIG_SYSLOG_PREFIX_STRING);
#else
ret = 0;
ret += lib_sprintf(&stream.public, "%s", CONFIG_SYSLOG_PREFIX_STRING);
#endif
/* Generate the output */