Only test the return value in mktime_negyear

Testing for the errno is an optional requirement according to POSIX, and
FreeBSD doesn't document that errno would be set on failure with mktime

Submitted by: pho
Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
Enji Cooper 2014-10-13 02:44:35 +00:00
parent 8a05dd8595
commit 13727fa5e8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=273024

View File

@ -72,7 +72,12 @@ ATF_TC_BODY(mktime_negyear, tc)
errno = 0;
t = mktime(&tms);
#if defined(__FreeBSD__)
/* Open Group says "and may set errno to indicate the error" */
ATF_REQUIRE(t == (time_t)-1);
#else
ATF_REQUIRE_ERRNO(0, t != (time_t)-1);
#endif
}
ATF_TC(timegm_epoch);