time.h: Add localtime prototypes; NSH: Correct test for gmtime_r return value
This commit is contained in:
parent
17a0e206c6
commit
49bb0ed48e
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user