time.h: Add localtime prototypes; NSH: Correct test for gmtime_r return value

This commit is contained in:
Gregory Nutt 2015-04-21 09:26:18 -06:00
parent 17a0e206c6
commit 49bb0ed48e

View File

@ -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;