From 56e7f9c5eb57f41bff12067ab49a3a56a274f6cd Mon Sep 17 00:00:00 2001 From: ngie Date: Mon, 13 Oct 2014 02:44:35 +0000 Subject: 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 --- contrib/netbsd-tests/lib/libc/time/t_mktime.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'contrib/netbsd-tests') diff --git a/contrib/netbsd-tests/lib/libc/time/t_mktime.c b/contrib/netbsd-tests/lib/libc/time/t_mktime.c index 8092361..caef906 100644 --- a/contrib/netbsd-tests/lib/libc/time/t_mktime.c +++ b/contrib/netbsd-tests/lib/libc/time/t_mktime.c @@ -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); -- cgit v1.1