mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-19 11:23:07 +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 */
|
||||
|
||||
ret = gmtime_r((FAR const time_t*)&ts.tv_sec, &tm);
|
||||
if (ret < 0)
|
||||
if (gmtime_r((FAR const time_t*)&ts.tv_sec, &tm) == NULL)
|
||||
{
|
||||
nsh_output(vtbl, g_fmtcmdfailed, name, "gmtime_r", NSH_ERRNO);
|
||||
return ERROR;
|
||||
|
Reference in New Issue
Block a user