Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Oct 2014 02:44:36 +0000 (UTC)
From:      Garrett Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r273024 - head/contrib/netbsd-tests/lib/libc/time
Message-ID:  <201410130244.s9D2iama042530@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Mon Oct 13 02:44:35 2014
New Revision: 273024
URL: https://svnweb.freebsd.org/changeset/base/273024

Log:
  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

Modified:
  head/contrib/netbsd-tests/lib/libc/time/t_mktime.c

Modified: head/contrib/netbsd-tests/lib/libc/time/t_mktime.c
==============================================================================
--- head/contrib/netbsd-tests/lib/libc/time/t_mktime.c	Mon Oct 13 02:32:37 2014	(r273023)
+++ head/contrib/netbsd-tests/lib/libc/time/t_mktime.c	Mon Oct 13 02:44:35 2014	(r273024)
@@ -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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410130244.s9D2iama042530>