From 49bb0ed48e3b8dce62c525cb96c5245329802b95 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 21 Apr 2015 09:26:18 -0600 Subject: [PATCH] time.h: Add localtime prototypes; NSH: Correct test for gmtime_r return value --- nshlib/nsh_timcmds.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nshlib/nsh_timcmds.c b/nshlib/nsh_timcmds.c index a6fbc1656..78066b354 100644 --- a/nshlib/nsh_timcmds.c +++ b/nshlib/nsh_timcmds.c @@ -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;