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

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