Commit Graph

465 Commits

Author SHA1 Message Date
Roland McGrath
d6c33fda03 Switch gettimeofday from INTUSE to libc_hidden_proto. 2012-05-24 13:12:34 -07:00
Paul Eggert
f8591f8049 mktime: avoid signed integer overflow
* time/mktime.c (__mktime_internal): Do not mishandle the case
where diff == INT_MIN.
2012-05-23 14:36:25 -07:00
Paul Eggert
94c7d826c9 mktime: simplify computation of average
* time/mktime.c (ranged_convert): Use new time_t_avg function
instead of rolling our own (probably-slower) code.
2012-05-23 14:36:25 -07:00
Paul Eggert
ce73d68397 mktime: do not assume signed right shift propagates sign bit
* time/mktime.c (isdst_differ): New static function.
(__mktime_internal): No need to normalize tm_isdst now.
(__mktime_internal, not_equal_tm): Use isdst_differ to compare
tm_isdst values.
2012-05-23 14:36:24 -07:00
Paul Eggert
72a22e596c mktime: merge another wrapv change from gnulib
* time/mktime.c (TYPE_MAXIMUM): Rework slightly to avoid diagnostics
from some compilers.
2012-05-23 14:36:24 -07:00
Paul Eggert
6860543348 mktime: remove incorrect attempt at unusual arithmetics
* time/mktime.c (TYPE_ONES_COMPLEMENT, TYPE_SIGNED_MAGNITUDE): Remove.
The code didn't really work on such machines anyway.
(TYPE_MINIMUM): Assume two's complement.
(twos_complement_arithmetic): Verify that long_int and time_t
are two's complement (or unsigned, in the latter case).
2012-05-23 14:36:24 -07:00
Paul Eggert
03cf7fe31b mktime: check signed shifts on long_int and time_t, too
* time/mktime.c (SHR): Check that shifts work as desired
on the types long_int and time_t too, as SHR is used on
such types.
2012-05-23 14:36:24 -07:00
Paul Eggert
f04dfbc244 mktime: do not assume 'long' is wide enough
* time/mktime.c (verify): Move decl up.
(long_int): New type.
(leapyear, ydhms_diff, guess_time_tm, __mktime_internal): Use it,
to remove assumption in the code that 'long' is wide enough to
store year values.  This assumption is not true on x32 and on
some non-glibc platforms.
2012-05-23 14:36:24 -07:00
Paul Eggert
62bdf9a683 mktime: merge wrapv change from gnulib
* time/mktime.c (WRAPV): New macro.
(time_t_avg, time_t_add_ok, time_t_int_add_ok): New static functions.
(guess_time_tm, __mktime_internal): Do not assume that signed
integer overflow wraps around; modern compilers generate code
where this assumption is no longer valid.
2012-05-23 14:36:24 -07:00
H.J. Lu
98a61bcbca Update copyright years for time/mktime.c 2012-05-22 06:31:00 -07:00
Paul Eggert
6226efbda1 mktime: merge comment-quoting-style change from gnulib 2012-05-22 06:14:01 -07:00
Paul Eggert
b99e4f783c time/mktime.c (compile-command): Add "-I." 2012-05-22 06:13:01 -07:00
Paul Eggert
643e01e6cb mktime: merge mktime-internal.h change from gnulib 2012-05-22 06:11:29 -07:00
Paul Eggert
2554247d83 mktime: merge time_r change from gnulib 2012-05-22 06:10:34 -07:00
Paul Eggert
826dd0abdf mktime: merge DEBUG change from gnulib 2012-05-22 06:09:01 -07:00
Paul Eggert
bd83aabe5a mktime: merge <sys/types.h> change from gnulib 2012-05-22 06:07:58 -07:00
Paul Eggert
95770f140b mktime: merge HAVE_CONFIG_H change from gnulib 2012-05-22 06:05:37 -07:00
H.J. Lu
48970aba30 Fold copyright years 2012-05-16 20:02:44 -07:00
Roland McGrath
61653dfb81 BZ#10375: Configure magic to use -U_FORTIFY_SOURCE if needed. 2012-05-16 16:20:59 -07:00
H.J. Lu
a46f2169d3 Remove __snseconds_t 2012-05-15 18:05:26 -07:00
Ian Wienand
b9f1922d7e Fix daylight time change for the US
[BZ #14080]
	* time/tzset.c (__tzset_parse_tz): Update default rules for
	daylight time changes in the Energy Policy Act of 2005.
2012-05-09 06:15:56 +02:00
H.J. Lu
4be2b57003 Add __snseconds_t and __SNSECONDS_T_TYPE 2012-04-11 11:02:59 -07:00
Thomas Schwinge
302cadd343 Testsuite #include fixes. 2012-04-02 22:31:32 +02:00
H.J. Lu
f196c7f7af Use time_t on ays, rem, y and yg in __offtime 2012-03-16 09:10:12 -07:00
Ulrich Drepper
a4300c7a4d Remove distribute variable from Makefiles 2012-03-07 05:17:13 -05:00
Ulrich Drepper
7a270350a9 Fix ISO C11 definitions in time.h 2012-02-25 21:28:27 -05:00
Paul Eggert
59ba27a63a Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
Joseph Myers
c8a89e7dd5 Remove miscellaneous __STDC__ conditionals. 2012-01-30 21:20:32 +00:00
Ulrich Drepper
a784e50247 Remove pre-ISO C support
No more __const.
2012-01-07 23:57:22 -05:00
Ulrich Drepper
74033a2507 Implement timespec_get 2012-01-01 07:17:21 -05:00
Ulrich Drepper
8fa26d571d Fix one typo 2011-12-21 18:57:18 -05:00
Ulrich Drepper
97ac2654b2 Check values from TZ file header 2011-12-17 20:18:42 -05:00
Ulrich Drepper
312be3f9f5 Clean up internal fopen uses
No need to ever not use c and e.
2011-11-15 04:24:42 -05:00
Ulrich Drepper
82af0fa8de Use O_CLOEXEC in tzfile handling 2011-11-14 18:46:46 -05:00
Jim Meyering
ded5b9b7c7 Remove doubled words. 2011-04-22 21:34:32 -04:00
Ulrich Drepper
4c1423edfb Fix typos in comments. 2011-04-01 10:39:30 -04:00
Ulrich Drepper
f095bb7204 Add support for XPG7 testing.
The header conformance testing code needed extending for XPG7.  This
exposed a few bugs in the headers.  There are more changes to come.
2010-01-09 10:56:41 -08:00
Keith Stribley
3c2c4bf6f7 Implement Burmese language locale for Myanmar. 2009-10-30 08:14:02 -07:00
Andreas Schwab
7a7c2c2465 Handle empty TZ strings at the end of new-style timzeone files correctly. 2009-06-23 09:13:30 -07:00
Ulrich Drepper
6355c99740 Fix computation of tzspec_len.
Without this it should never have worked that we can use the
embedded envvar in the timezone data files for dates after the last
matching rule.
2009-06-15 11:00:08 -07:00
Akinori Hattori
29143408ae Handle leap seconds even if no DST rule exists.
This fixes BZ #10211.
2009-06-15 10:54:26 -07:00
Andreas Schwab
ff6ff38db2 Remove redundant .gitignore files. 2009-05-16 10:18:34 +02:00
Jim Meyering
2e180a2622 rename each .cvsignore file to .gitignore 2009-05-15 18:13:37 +02:00
Ulrich Drepper
bd82a24718 * time/tzset.c: Optimize a bit for size. 2009-03-10 17:00:17 +00:00
Ulrich Drepper
686f8c9daf * time/tzset.c (__tzset_parse_tz): Use correct string when parsing
DST name.
	* time/tst-posixtz.c: Add tests for quoted timezone names.
2009-03-10 15:23:46 +00:00
Ulrich Drepper
6cbe890a9d * wctype/wctype.h: The *_l functions are in POSIX 2008.
* wcsmbs/wchar.h: mbsnrtowcs, open_wmemstream, wcpcpy, wcpncpy,
	wcscasecmp, wcsdup, wcsncasecmp, wcsnlen, wcsnrtombs,
	wcscasecmp_l, wcsncasecmp_l, wcscoll_l, and wcsxfrm_l.
	* sysdeps/mach/hurd/bits/posix_opt.h: Reset value of macros from
	200112L to 200809L.
	* sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
	* posix/getconf.c (vars): Add _SC_THREAD_ROBUST_PRIO_INHERIT and
	_SC_THREAD_ROBUST_PRIO_PROTECT entries.
	* bits/confname.h: Add _SC_THREAD_ROBUST_PRIO_INHERIT and
	_SC_THREAD_ROBUST_PRIO_PROTECT.
	* posix/unistd.h: fexecve is in POSIX 2008.
	* time/time.h: strftime_l is in POSIX 2008.
	* io/sys/stat.h: futimens is in POSIX 2008.
	* string/strings.h: strcasecmp_l and strncasecmp_l are in POSIX 2008.
	* string/string.h: stpcpy, stpncpy, strndup, strnlen, strsignal,
	strcoll_l, strerror_l, and strxfrm_l are in POSIX 2008.
	* stdlib/stdlib.h: mkdtemp is in POSIX 2008.
2009-02-26 16:53:30 +00:00
Ulrich Drepper
3e6b0a28eb * include/features.h: Define macros for XPG7/POSIX 2008.
* sysdeps/unix/sysv/linux/bits/stat.h: Protect UTIME_NOW and
	UTIME_OMIT only with __USE_ATFILE.
	* sysdeps/unix/sysv/linux/ia64/bits/stat.h: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/bits/stat.h: Likewise.
	* sysdeps/unix/sysv/linux/s390/bits/stat.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/bits/stat.h: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/bits/stat.h: Likewise.
	* io/sys/stat.h: Move mknodat definition into same conditional as
	mknod.
	* time/sys/time.h: futimesat is not among the functions accepted
	into the POSIX standard.
2009-02-26 01:43:53 +00:00
Ulrich Drepper
82780cbee5 * time/tzset.c (tzset_internal): Correct parsing of TZ envvar. 2009-02-24 22:45:58 +00:00
Ulrich Drepper
970aa10f95 * time/tzset.c (__tzset_parse_tz): DST offset must also allow hour
value of 24.
2009-02-05 20:09:58 +00:00
Ulrich Drepper
d35a163b3d (__mktime_internal): Normalize tp->tm_isdst value. 2008-07-06 21:17:58 +00:00