aboutsummaryrefslogtreecommitdiff
path: root/contrib/tzcode/stdtime
Commit message (Collapse)AuthorAgeFilesLines
* MFC r313774: localtime: return NULL if time_t out of range of struct tmEd Maste2017-03-011-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we would truncate tm.tm_year for any time_t corresponding to a year that does not fit in int. This issue was discovered because it caused the bash-static build to fail when linking with LLD. As reported by Rafael EspĂ­ndola: Configure has AC_FUNC_MKTIME which expands to a test of mktime that fails with the freebsd implementation. Given that, bash compiles a mktime.o file that defines just mktime and uses localtime. That goes in a .a file that is before libc. The freebsd libc defines mktime in localtime.o, which also defines localtime among other functions. When lld sees an undefined reference to mktime from libc, it uses the bash provided one and then tries to find a definition of localtime. It is found on libc's localtime.o, but now we have a duplicated error. The reason it works with bfd is that bash doesn't use mktime directly and the undefined reference from libc is resolved to the libc implementation. It would also fail to link if bash itself directly used mktime. The bash-static configure test verifies that, for many values of t, either localtime(t) returns NULL or mktime(localtime(t)) == t. This test failed when localtime returned a truncated tm_year. This was fixed in tzcode in 2004 but has persisted in our tree since rS2708. Sponsored by: The FreeBSD Foundation Notes: svn path=/stable/11/; revision=314447
* Merge:Craig Rodrigues2015-10-083-80/+45
| | | | | | | | | | | | | commit 400ecf36bb0b73f6390f9641e6cb8bbfb91a5cfd Author: Paul Eggert <eggert@cs.ucla.edu> Date: Fri Oct 12 07:53:12 2012 -0700 Assume C89. https://github.com/eggert/tz/commit/400ecf36bb0b73f6390f9641e6cb8bbfb91a5cfd Notes: svn path=/head/; revision=289027
* Revert WiP to contrib/tzcode accidentally committed with r274364Enji Cooper2014-11-111-10/+2
| | | | Notes: svn path=/head/; revision=274365
* Add baud rate support to telnet(1)Enji Cooper2014-11-111-2/+10
| | | | | | | | | | | | | | | | This implements part of RFC-2217 It's based off a patch originally written by Sujal Patel at Isilon, and contributions from other Isilon employees. PR: 173728 Phabric: D995 Reviewed by: markj, markm MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=274364
* Fix typo. Note that although this file is under contrib, it has divergedGavin Atkinson2014-05-151-1/+1
| | | | | | | | | | | | | sufficiently from upstream (including a full whitespace commit and large portions rewritten) that this change does not move us further from the upstream. PR: docs/186608 Submitted by: Jamie Landeg-Jones <jamie@dyslexicfish.net> MFC after: 3 days Notes: svn path=/head/; revision=266111
* tzfile.5: catch up to r204333Benjamin Kaduk2013-12-161-1/+1
| | | | | | | | | | | | | | | The stdtime sources were moved from lib/libc to contrib/tzcode, and tzfile.h is not an installed header, so the man page refers to its location in the source tree. The documentation could be more clear about the internal nature of the header, but those changes should go through upstream tzcode. PR: docs/176864 Approved by: hrs (mentor) Notes: svn path=/head/; revision=259446
* Fix a memory leak in tzload().Mikolaj Golub2011-10-271-0/+1
| | | | | | | | | Reported by: valgrind Reviewed by: kib MFC after: 3 days Notes: svn path=/head/; revision=226828
* Do not overallocate on the stack. Threaded code might use custom stackKonstantin Belousov2011-09-191-43/+69
| | | | | | | | | | | | | size. Reported by: many Tested by: Jeremie Le Hen <jeremie@le-hen.org> (previous version) Reviewed by: jilles Approved by: re (bz) MFC after: 2 weeks Notes: svn path=/head/; revision=225677
* Sync code with tzcode2010mEdwin Groothuis2010-10-272-27/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | asctime.c: * Set errno to EINVAL and return "??? ??? ?? ??:??:?? ????\n" if asctime_r is called with a NULL struct tm pointer. (Note that asctime_r is called by ctime_r and asctime; asctime is called by ctime.) localtime.c: * Set errno to EINVAL and return WRONG if time1 is called with a NULL struct tm pointer; avoid dereference if a NULL struct tm pointer is passed to timelocal, timegm, or timeoff. (Note that time1 is called by mktime, timegm, and timeoff; mktime is called by timelocal.) * more core-avoidance work * Change to set timezone and altzone based on time types with greatest transition times (for the benefit of Asia/Seoul). zic.8: * Warning about case-sensitivity of names, but not of abbrevations zic.c: * Conditionally output extra types with most-recently-use offsets last (for use by systems with pre-2011 versions of localtime.c, helping to ensure that globals "altzone and "timezone" get set correctly). The code has been running for nearly four weeks on my laptop running FreeBSD 8.1 without a problem. MFC after: 1 month Notes: svn path=/head/; revision=214411
* Remove non-contributed code.Edwin Groothuis2010-02-259-1976/+0
| | | | Notes: svn path=/head/; revision=204336
* Copy lib/libc/stdtime to contrib/tzcode/stdtime for the proper splitEdwin Groothuis2010-02-2517-0/+5595
of contributed code and FreeBSD specific code. Notes: svn path=/head/; revision=204333