mirror of
https://github.com/opnsense/src.git
synced 2026-06-04 06:15:33 -04:00
date: Correctly check outcome of mktime().
X-MFC-With: 7b390cb636
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D44982
This commit is contained in:
parent
b30a7e5418
commit
dafb424b8d
1 changed files with 3 additions and 1 deletions
|
|
@ -334,7 +334,9 @@ setthetime(const char *fmt, const char *p, int jflag, struct timespec *ts)
|
|||
}
|
||||
|
||||
/* convert broken-down time to GMT clock time */
|
||||
if ((ts->tv_sec = mktime(lt)) == -1)
|
||||
lt->tm_yday = -1;
|
||||
ts->tv_sec = mktime(lt);
|
||||
if (lt->tm_yday == -1)
|
||||
errx(1, "nonexistent time");
|
||||
ts->tv_nsec = 0;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue