mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-19 19:44:35 +08:00
time.h: Add localtime prototypes; NSH: Correct test for gmtime_r return value
This commit is contained in:
@@ -125,8 +125,7 @@ static inline int date_showtime(FAR struct nsh_vtbl_s *vtbl, FAR const char *nam
|
|||||||
|
|
||||||
/* Break the current time up into the format needed by strftime */
|
/* Break the current time up into the format needed by strftime */
|
||||||
|
|
||||||
ret = gmtime_r((FAR const time_t*)&ts.tv_sec, &tm);
|
if (gmtime_r((FAR const time_t*)&ts.tv_sec, &tm) == NULL)
|
||||||
if (ret < 0)
|
|
||||||
{
|
{
|
||||||
nsh_output(vtbl, g_fmtcmdfailed, name, "gmtime_r", NSH_ERRNO);
|
nsh_output(vtbl, g_fmtcmdfailed, name, "gmtime_r", NSH_ERRNO);
|
||||||
return ERROR;
|
return ERROR;
|
||||||
|
Reference in New Issue
Block a user