| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
| |
* lib/mktime.c (__mktime_internal): Fix misspelling in comment.
This merges all recent glibc changes of importance.
|
|
|
|
| |
Run the new "make update-copyright" rule.
|
|
|
|
|
| |
Use the same procedure as for 2009, outlined in
http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/20081
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* lib/mktime-internal.h: New file.
* lib/mktime.c: Use it rather than open-coding a declaration.
* lib/timegm.c: Likewise.
* modules/mktime (Files): Ship it.
* modules/timegm (Files): Likewise.
Suggested by Bruno Haible.
Signed-off-by: Eric Blake <ebb9@byu.net>
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib/fchmodat.c (lchmod): Mark unused variables.
* lib/getopt.c (_getopt_initialize): Likewise.
* lib/mktime.c (__mktime_internal): Provide prototype.
* lib/inttostr.c (inttostr): Avoid compiler warning even with
older gcc that do not understand #pragma GCC diagnostic.
* lib/uinttostr.c (inttype_is_unsigned): Define.
* lib/umaxtostr.c (inttype_is_unsigned): Likewise.
Signed-off-by: Eric Blake <ebb9@byu.net>
|
| |
|
|
|
|
|
|
| |
* lib/mktime.c (__mktime_internal): Normalize tp->tm_isdst value.
Reported by Michael Ringe <Michael.Ringe@gmx.de> in
<http://sourceware.org/bugzilla/show_bug.cgi?id=6723>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
POSIX and GNU instead of separate include files like time_r.h
and timegm.h. This implementation tries out a simpler approach
for replacing decls in standard include files (as compared to
the string module), somewhat as an experiment.
* config/srclist.txt: Comment out mktime.c for now.
* doc/gnulib-tool.texi (Initial import): Don't use time_r as an example
since it doesn't apply any more. Use generic wording instead.
* MODULES.html.sh (Support for systems lacking POSIX:2001): New module
'time'.
* lib/time_.h, m4/time_h.m4, modules/time: New files.
* lib/strptime.h, lib/time_r.h, lib/timegm.h: Remove.
* lib/mktime.c: Include config.h depending on _LIBC, not HAVE_CONFIG_H.
Don't include <sys/types.h>; no longer needed since we assume C89.
* lib/mktime.c: Don't include "time_r.h"; no longer needed.
* lib/strftime.c: Likewise.
* lib/time_r.c: Likewise.
* lib/nanosleep.c (nanosleep): #undef after include files, not before.
* lib/nanosleep.c: Include <time.h> first, to check interface.
* lib/strptime.c: Likewise.
* lib/time_r.c: Likewise.
* lib/timegm.c: Likewise.
* lib/strptime.c: Don't include strptime.h or time_r.h; no longer
needed.
* lib/timegm.c: Don't include timegm.h; no longer needed.
* lib/timespec.h: Don't include <sys/time.h> before <time.h>;
time.h now handles any problems in that area.
(struct timespec, nanosleep): Remove; time.h now arranges for these.
* lib/xnanosleep.c: Don't include timespec.h; no longer needed now
that time.h defines struct timespec.
* m4/nanosleep.m4 (gl_FUNC_NANOSLEEP): Check that nanosleep is declared.
Set REPLACE_NANOSLEEP. Don't AC_DEFINE nanosleep; the time module now
handles that.
* m4/strptime.m4 (gl_FUNC_STPRTIME): Set REPLACE_STRPTIME.
* m4/time_r.m4 (gl_TIME_R): Don't define HAVE_TIME_R_POSIX; no longer
needed. Set REPLACE_LOCALTIME.
* m4/timegm.m4 (gl_FUNC_TIMEGM): Set REPLACE_TIMEGM.
* m4/timespec.m4 (gl_CHECK_TYPE_STRUCT_TIMESPEC): Move to time_h.m4.
(gl_TIMESPEC): Don't check for sys/time.h or struct timespec or
nanosleep; time_h.m4 now does that. Don't require
gl_USE_SYSTEM_EXTENSIONS; no longer needed directly, and the time
module handles this now.
* modules/getdate (Depends-on): Remove timespec. Add time.
* modules/nanosleep (Depends-on): Likewise.
* modules/stat-time (Depends-on): Likewise.
* modules/nanosleep (Include): Include time.h, not timespec.h.
* modules/strptime (Files): Remove lib/strptime.h.
(Depends-on): Add extensions, time.
(Include): Include time.h, not strptime.h.
* modules/time_r (Files): Remove lib/time_r.h.
(Depends-on): Add time.
(Include): Include time.h, not time_r.h.
* modules/timegm: Likewise.
* modules/timespec (Description): Now does timespec-related decls
of our own, instead of struct timespec itself.
(Depends-on): Add time; remove extensions.
(Maintainer): Add self.
* modules/utimecmp (Depends-on): Add time; remove timespec.
* modules/utimens (Depends-on): Likewise.
* modules/xnanosleep (Depends-on): Likewise.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
2821 is fixed.
* lib/mktime.c (guess_time_tm): Fix bug where mktime
returned the maximum time_t value rather than (time_t) -1.
Problem originally reported by William Bardwell
<http://sourceware.org/bugzilla/show_bug.cgi?id=2821>.
* m4/mktime.m4 (AC_FUNC_MKTIME): Sync from Autoconf.
Check for unistd.h too, since Autoconf doesn't assume POSIX.
Also:
2006-09-08 Paul Eggert <eggert@cs.ucla.edu>
Add year_2050_test to catch glibc bug 2821
<http://sourceware.org/bugzilla/show_bug.cgi?id=2821>.
2006-08-15 Paul Eggert <eggert@cs.ucla.edu>
Prefer #ifdef to #if.
2006-04-02 Paul Eggert <eggert@cs.ucla.edu>
Return from 'main' instead of calling 'exit'.
|
| |
|
|
|
|
|
|
|
|
|
| |
(ranged_convert): Don't save conversion in a temporary struct.
This causes a warning with GCC 4.0.0, and anyway in the typical
case it's not worth the extra 100 bytes or so of code.
(ranged_convert, __mktime_internal): When calling a function via a
pointer P, use P () rather than (*P) (), as we now assume C89 or
better.
|
| |
|
| |
|
|
|
|
|
|
| |
TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
intprops.h.
* strtol.c: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
glibc-related files.
* lib/intprops.h: New file.
* lib/getloadavg.c: Include it instead of limits.h.
(INT_STRLEN_BOUND): Remove.
* lib/human.c: Include intprops.h.
(group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
* lib/human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
* lib/inttostr.h: Include intprops.h instead of limits.h.
(INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
* lib/mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
for consistency with intprops.h.
(time_t_is_integer, twos_complement_arithmetic): Use them.
* lib/sig2str.h: Include <signal.h>, intprops.h.
(INT_STRLEN_BOUND): Remove.
* lib/strftime.c (TYPE_SIGNED): Remove.
(INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
* lib/strtol.c: Adjust comments to match intprops.h.
* lib/userspec.c: Include intprops.h.
(TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
* lib/utimecmp.c, lib/xnanosleep.c, lib/xstrtol.c: Likewise.
* lib/utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
instead of rolling our own expressions.
* lib/xstrtol.c: Include xstrtol.h first, to test interface.
* modules/getloadavg (Files): Add lib/intprops.h.
* modules/human (Files): Likewise.
* modules/inttostr (Files): Likewise.
* modules/sig2str (Files): Likewise.
* modules/userspec (Files): Likewise.
* modules/utimecmp (Files): Likewise.
* modules/xnanosleep (Files): Likewise.
* modules/xstrtol (Files): Likewise.
|
| |
|
|
|
|
| |
convert T2, not T. (Imported from libc.)
|
|
|
|
|
|
|
| |
substitute for >> that should work even on Crays.
(TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
Problem reported by Mark D. Baushke in
<http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
|
| |
|
| |
|
|
|
|
|
| |
so as not to conflict with a different-sized __mktime_internal
function in GNU libc.
|
| |
|
|
|
|
|
| |
and gmtime_r, now supplied by the time_r module. This fixes some timegm
bugs and cleans up mktime and strftime a bit.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Issue a compile-time diagnostic if time_t is floating point, or if
two's complement arithmetic is not in effect, or if arithmetic
right shift does not propagate the sign. These assumptions were
all in the original code but they weren't checked.
(TIME_T_MIDPOINT, verify): New macros.
(__isleap): Remove; it has integer overflow problems.
(leapyear): New function, without those problems.
(ydhms_tm_diff): Remove; splitting into two parts.
(ydhms_diff): New function, containing the arithmetic part of
the old ydhms_tm_diff function. Issue a compile-time
diagnostic if we are not using C99 integer division.
Avoid casts when possible.
(guess_time_tm): New function, containing the checking part of
the old ydhms_tm_diff function. Return the new value, rather than
the difference between it and the old. Accept a new argument T
so that *T specifies the old value. Check for overflow in the result.
(__mktime_internal): Use a time_t offset, not a long int offset.
This undoes the 2003-06-04 change, which is no longer needed now
that we have better overflow checking.
(localtime_offset): Likewise.
(__mktime_internal): Avoid harmful overflow on hosts where time_t
and long are 64-bit but int is only 32-bit.
(ydhms_diff): Use long int to store year1 and yday1.
Issue a compile-time diagnostic if long int is not wide enough.
(__mktime_internal): Use long int to store adjusted year and yday.
Use plain C rather than preprocessor commands, if that doesn't
affect efficiency.
Check for overflow (and try to repair) after each probe
rather than checking only at the very end. This avoids some bugs
(e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
does not equal GMT offset at maximum time).
Use integer to check for overflow rather than floating point; this
is more portable to non-IEEE hosts, and is a tad faster.
When we detect that we are oscillating between two values,
don't check whether tm_isdst has the requested value, since
we already know the answer. When tm_isdst has the wrong value,
use a different heuristic to find the right one, based on the
extreme values actually observed in practice in tz2003a,
rather than the (overly optimistic) "previous 3 calendar quarters".
(not_equal_tm, print_tm, check_result): Use "const T" rather than
"T const" to accommodate glibc style.
(check_result): Use less-confusing report format. "long" -> "long int.
(main): Likewise.
Don't loop if the iteration overflows time_t.
Allow a negative step in the iteration.
|
|
|
|
|
|
|
|
|
| |
(HAVE_LIMITS_H): Remove. Assume it's 1.
(__P): Remove; not used.
(INT_MIN, INT_MAX): Remove; <limits.h> defines them.
(mktime, not_equal_tm, print_tm, check_result,
main): Use prototypes. Use const * where appropriate.
(main): Fix typo in testing code that uncovered by above changes.
|
|
|
|
|
|
|
|
| |
<http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
(localtime_offset): Now long int, not time_t, because we want it
to be guaranteed to be signed. All uses changed.
(__mktime_internal): If overflow would occur when adding offset,
don't add it.
|
|
|
|
| |
where mktime isn't the inverse of localtime (negative time_t).
|
| |
|
| |
|
|
|
|
| |
Thanks, Karl!
|
| |
|
| |
|
|
|
|
|
|
| |
(STATIC): Define to be empty (_LIBC) or `static' (otherwise).
(__mon_yday): Declare with the STATIC attribute.
(__mktime_internal): Likewise.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
problematic) notion of what to do when tm_isdst doesn't match.
From Paul Eggert.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
library's localtime_r and gmtime_r; there are too many buggy
implementations of localtime_r and gmtime_r out there, and
it's not worth keeping track of all the different bugs.
* mktime.c (__EXTENSIONS__, HAVE_LOCALTIME_R): Remove.
(my_mktime_localtime_r): Renamed from localtime_r; all uses changed.
Base it on localtime unless _LIBC.
|
| |
|
|
|
|
| |
localtime_r to be declared properly.
|
| |
|
|
|
|
|
|
|
|
| |
in a spring-forward gap of size DT, return a time that is DT
away from the requested time, preferring a time whose tm_isdst
differs from the requested value. Bump the max number of
probes from 4 to 6 to account for the extra probes needed to
discover a spring-forward gap in the worst case.
|
|
|
|
|
|
| |
Define also if HAVE_LOCALTIME_R && defined (localtime_r), with
a body that merely expands localtime_r; this works around a
bug in Digital Unix 4.0A and 4.0D.
|
| |
|
| |
|
| |
|