summaryrefslogtreecommitdiff
path: root/lib/mktime.c
Commit message (Collapse)AuthorAgeFilesLines
* all: prefer https: URLsPaul Eggert2017-09-131-1/+1
|
* tzset: Expand comment about TZ problem on native Windows.Bruno Haible2017-05-091-3/+22
| | | | | | | | | | * lib/tzset.c (tzset): Elaborate comment, based on explanations by Paul Eggert. * lib/ctime.c (rpl_ctime): Likewise. * lib/localtime.c (rpl_localtime): Likewise. * lib/mktime.c (mktime): Likewise. * lib/strftime-fixes.c (rpl_strftime): Likewise. * lib/wcsftime.c (rpl_wcsftime): Likewise.
* mktime: Work around TZ problem on native Windows.Bruno Haible2017-04-301-3/+44
| | | | | | | | | | | | | | | | | | | | * lib/mktime.c: Add #ifs to make the algorithmic workaround independent from the native Windows workaround. * m4/mktime.m4 (gl_FUNC_MKTIME_WORKS): New macro, extracted from gl_FUNC_MKTIME. If guessing, set gl_cv_func_working_mktime to 'guessing no'. (gl_FUNC_MKTIME): Require it. Require AC_CANONICAL_HOST. Set REPLACE_MKTIME to 1 on native Windows. Define NEED_MKTIME_WORKING, NEED_MKTIME_WINDOWS. (gl_FUNC_MKTIME_INTERNAL): Require gl_FUNC_MKTIME_WORKS, not gl_FUNC_MKTIME. Set WANT_MKTIME_INTERNAL, not REPLACE_MKTIME. Define NEED_MKTIME_INTERNAL. * m4/timegm.m4 (gl_FUNC_TIMEGM): Require gl_FUNC_MKTIME_WORKS, not gl_FUNC_MKTIME. Cope with 'guessing yes' value. * modules/mktime-internal (configure.ac): Test WANT_MKTIME_INTERNAL, not REPLACE_MKTIME. * doc/posix-functions/mktime.texi: Mention the native Windows workaround.
* maint: time stamp -> timestampPaul Eggert2017-01-091-1/+1
| | | | Use the spelling "timestamp", as that is what POSIX uses.
* version-etc: new yearPaul Eggert2017-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* mktime: call tzset as per POSIXPaul Eggert2016-07-031-0/+2
| | | | | | | Problem reported by Ludovic Courtès in: http://lists.gnu.org/archive/html/bug-gnulib/2016-06/msg00068.html * lib/mktime.c (mktime) [!_LIBC && HAVE_TZSET]: Call tzset. * m4/mktime.m4 (gl_FUNC_MKTIME): Check for tzset.
* mktime: spelling fix in commentPaul Eggert2016-05-011-1/+1
| | | | * lib/mktime.c: Fix spelling.
* mktime: port to stricter signed overflow checkingPaul Eggert2016-05-011-200/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | * lib/mktime.c: Omit 'pragma GCC optimize ("wrapv")'. (long_int): Require width for INT_MAX * 3 * (seconds per year), instead of merely for INT_MAX * 2. In practice platforms that do the latter also do the former. (TIME_T_MIN, TIME_T_MAX, TIME_T_MIDPOINT, SHR): Remove. (shr): New static function, replacing SHR. All uses changed. (mktime_min, mktime_max): New constants, replacing TIME_T_MIN and TIME_T_MAX. All uses changed. (ydhms_diff, guess_time_tm, ranged_convert, __mktime_internal): Use long_int, not time_t. (long_int_avg): New static function, replacing time_t_avg. All uses changed. Round toward positive infinity, as that generates slightly better code. (time_t_add_ok, time_t_int_add_ok): Remove. All uses replaced by INT_ADD_WRAPV. (guess_time_tm): Accept time, not a pointer to it. All uses changed. (convert_time): New static function. (ranged_convert): Use it (ranged_convert): Check for *T out of [mktime_min, mktime_max] range. Use simpler test for loop exit. (__mktime_internal): Store negative of guessed offset, to simplify overflow checking. Remove no-longer-needed test for small time_t overflows.
* mktime: speed up DEBUG_MKTIME benchmarksPaul Eggert2016-05-011-12/+15
| | | | | | | | | | | Call tzset just once, at the start, rather than for every test case. This lets us measure the CPU cost of mktime as opposed to that of tzset. This is relevant when TZ is not set and glibc is being used. This speeds up tests by a factor of 40 on my Fedora 23 x86-64 platform. * lib/mktime.c (main) [DEBUG_MKTIME]: Call localtime at the start, to call tzset and as a sanity check. Later on, use localtime_r instead of localtime.
* mktime: resurrect DEBUG_MKTIME testingPaul Eggert2016-05-011-1/+2
| | | | | * lib/mktime.c [DEBUG_MKTIME]: Do not include <config.h>. Include <string.h>, for strcmp.
* mktime: simplify DEBUG_MKTIMEPaul Eggert2016-05-011-5/+7
| | | | | * lib/mktime.c (DEBUG_MKTIME): Define to 0 if not defined. Simplify later usage accordingly.
* Port mktime_internal offset to unsigned time_tPaul Eggert2016-05-011-7/+5
| | | | | | | | | | | | This avoids some assumptions about wraparound arithmetic on signed integer overflow. * lib/mktime-internal.h (mktime_offset_t): New type. (mktime_internal): Use it in decl. * lib/mktime.c, lib/timegm.c (mktime_offset_t) [_LIBC]: New type. * lib/mktime.c (__mktime_internal, localtime_offset): * lib/timegm.c (timegm): Use it. * m4/mktime.m4 (gl_TIME_T_IS_SIGNED): New macro. (gl_FUNC_MKTIME): Require it.
* mktime: improve integer overflow checkingPaul Eggert2016-04-131-78/+34
| | | | | | | | | | | | | * lib/mktime.c: Include stdbool.h, intprops.h, verify.h. (WRAPV): Remove; no longer needed. (verify): Remove. Replace all uses with call to verify.h 'verify'. (TYPE_IS_INTEGER, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove. Use intprops.h defns instead. (leapyear, isdst_differ, time_t_add_ok, time_t_int_ok): Use bool for Boolean, for clarity. (time_t_add_ok, time_t_int_add_ok): Use INT_ADD_WRAPV to detect integer overflow. * modules/mktime (Depends-on): Add intprops, stdbool, verify.
* intprops, mktime, strtol: assume two's complementPaul Eggert2016-04-131-20/+11
| | | | | | | | | | | | | | | | | | These macros were not portable to every conforming C11 ones' complement platform. It's not worth the hassle of porting to some platforms that use ones' complement or signed magnitude, as such platforms are almost purely theoretical nowadays and porting even to some of them makes the code harder to review for little practical benefit. Problem reported by Florian Weimer in: https://sourceware.org/ml/libc-alpha/2016-04/msg00295.html * lib/intprops.h (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT) (TYPE_SIGNED_MAGNITUDE, _GL_INT_TWOS_COMPLEMENT): * lib/mktime.c (TYPE_TWOS_COMPLEMENT): * lib/strtol.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT) (TYPE_SIGNED_MAGNITUDE): Remove. All uses rewritten to assume two's complement, which is all we can reasonably test nowadays anyway. * top/maint.mk (_intprops_names): Remove the removed macros.
* mktime: rename macro to avoid glibc clashMartin Sebor2016-01-121-6/+6
| | | | | * lib/mktime.c [DEBUG] (DEBUG): Rename to DEBUG_MKTIME. See: https://sourceware.org/ml/libc-alpha/2016-01/msg00267.html
* version-etc: new yearPaul Eggert2016-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* version-etc: new yearPaul Eggert2014-12-311-1/+1
| | | | | | * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date. * all files: Run 'make update-copyright'.
* mktime: merge #if/#ifdef usage from glibcPaul Eggert2014-06-271-2/+2
| | | | | | | * lib/mktime.c: Use "#if defined DEBUG && DEBUG", not "#if DEBUG", as that works with both Glibc's and Gnulib's style. See thread starting at Siddhesh Poyarekar's bug report at: http://lists.gnu.org/archive/html/bug-gnulib/2014-06/msg00102.html
* maint: update copyrightEric Blake2014-01-011-1/+1
| | | | | | I ran 'make update-copyright'. Signed-off-by: Eric Blake <eblake@redhat.com>
* maint: update all copyright year number rangesEric Blake2013-01-011-1/+1
| | | | | | Run "make update-copyright". Compare to commit 1602f0a from last year. Signed-off-by: Eric Blake <eblake@redhat.com>
* mktime: avoid 'static inline'Paul Eggert2012-08-191-2/+2
| | | | | * lib/mktime.c (leapyear, ydhms_diff): Now static, not static inline. * m4/mktime.m4 (gl_PREREQ_MKTIME): Do not require AC_C_INLINE.
* * lib/mktime.c: Revert autoupdate, which fetched the wrong version.Paul Eggert2012-05-251-80/+155
|
* autoupdateKarl Berry2012-05-251-155/+80
|
* mktime: sync from glibcPaul Eggert2012-05-231-194/+197
| | | | | | | | | | | * config/srclist.txt: Uncomment mktime.c. * lib/mktime.c: Sync from glibc master. This incorporates 3 changes. First, indent with tabs, since glibc uses tabs and doesn't want to change and we'd rather be identical to glibc. Also, two small coding changes: (isdst_differ): Use &&, not &, as && is the usual style. (__mktime_internal): Rename local var from abs_diff to approx_abs_diff for clarity.
* maint: replace FSF snail-mail addresses with URLsPaul Eggert2012-02-091-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * config/argz.mk, lib/accept4.c, lib/alignof.h, lib/alloca.in.h: * lib/alphasort.c, lib/arcfour.c, lib/arcfour.h, lib/arctwo.c: * lib/arctwo.h, lib/argz.c, lib/arpa_inet.in.h, lib/asnprintf.c: * lib/asprintf.c, lib/assert.in.h, lib/base32.c, lib/base32.h: * lib/base64.c, lib/base64.h, lib/c-ctype.c, lib/c-ctype.h: * lib/c-strcase.h, lib/c-strcasecmp.c, lib/c-strncasecmp.c: * lib/check-version.c, lib/check-version.h, lib/config.charset: * lib/ctype.in.h, lib/des.c, lib/des.h, lib/dup3.c, lib/errno.in.h: * lib/float+.h, lib/fnmatch.c, lib/fnmatch.in.h, lib/fnmatch_loop.c: * lib/fseeko.c, lib/gai_strerror.c, lib/gc-gnulib.c: * lib/gc-libgcrypt.c, lib/gc-pbkdf2-sha1.c, lib/gc.h: * lib/getaddrinfo.c, lib/getdelim.c, lib/getfilecon.c, lib/getline.c: * lib/getlogin_r.c, lib/getpass.c, lib/getpass.h, lib/gettext.h: * lib/gettimeofday.c, lib/glob.in.h, lib/glthread/cond.c: * lib/glthread/cond.h, lib/glthread/lock.c, lib/glthread/lock.h: * lib/glthread/thread.c, lib/glthread/thread.h: * lib/glthread/threadlib.c, lib/glthread/yield.h, lib/hmac-md5.c: * lib/hmac-sha1.c, lib/hmac.h, lib/iconv.c, lib/iconv.in.h: * lib/iconv_close.c, lib/iconv_open.c, lib/inet_ntop.c, lib/isfinite.c: * lib/isinf.c, lib/iswblank.c, lib/langinfo.in.h, lib/link.c: * lib/localcharset.c, lib/localcharset.h, lib/lseek.c, lib/malloc.c: * lib/malloca.c, lib/malloca.h, lib/md2.c, lib/md2.h, lib/md4.c: * lib/md4.h, lib/md5.c, lib/md5.h, lib/memmem.c, lib/mempcpy.c: * lib/memset.c, lib/memxor.c, lib/memxor.h, lib/minmax.h, lib/mktime.c: * lib/msvc-inval.c, lib/msvc-inval.h, lib/msvc-nothrow.c: * lib/msvc-nothrow.h, lib/netdb.in.h, lib/netinet_in.in.h, lib/nproc.c: * lib/nproc.h, lib/obstack_printf.c, lib/pathmax.h, lib/pipe.c: * lib/pipe2.c, lib/poll.c, lib/poll.in.h, lib/printf-args.c: * lib/printf-args.h, lib/printf-parse.c, lib/printf-parse.h: * lib/pselect.c, lib/pthread.in.h, lib/pty-private.h, lib/pty.in.h: * lib/read-file.c, lib/read-file.h, lib/ref-add.sin, lib/ref-del.sin: * lib/regcomp.c, lib/regex.c, lib/regex.h, lib/regex_internal.c: * lib/regex_internal.h, lib/regexec.c, lib/rijndael-alg-fst.c: * lib/rijndael-alg-fst.h, lib/rijndael-api-fst.c: * lib/rijndael-api-fst.h, lib/rint.c, lib/rintf.c, lib/rintl.c: * lib/round.c, lib/roundf.c, lib/roundl.c, lib/scandir.c, lib/select.c: * lib/sha1.c, lib/sha1.h, lib/size_max.h, lib/snprintf.c: * lib/stdalign.in.h, lib/stdarg.in.h, lib/stdbool.in.h: * lib/stddef.in.h, lib/stdint.in.h, lib/stdio.in.h, lib/str-kmp.h: * lib/str-two-way.h, lib/strcasecmp.c, lib/strcasestr.c, lib/strdup.c: * lib/striconv.c, lib/striconv.h, lib/string.in.h, lib/strings.in.h: * lib/strncasecmp.c, lib/strndup.c, lib/strnlen.c, lib/strpbrk.c: * lib/strptime.c, lib/strsep.c, lib/strstr.c, lib/strverscmp.c: * lib/sys_file.in.h, lib/sys_ioctl.in.h, lib/sys_select.in.h: * lib/sys_socket.in.h, lib/sys_stat.in.h, lib/sys_time.in.h: * lib/sys_times.in.h, lib/sys_types.in.h, lib/sys_uio.in.h: * lib/sys_utsname.in.h, lib/sys_wait.in.h, lib/tcgetsid.c: * lib/termios.in.h, lib/time.in.h, lib/time_r.c, lib/timegm.c: * lib/times.c, lib/unictype/3level.h, lib/unictype/3levelbit.h: * lib/unistd.in.h, lib/vasnprintf.c, lib/vasnprintf.h, lib/vasprintf.c: * lib/vsnprintf.c, lib/waitpid.c, lib/wchar.in.h, lib/wctype.in.h: * lib/xsize.h, tests/test-closein.c, tests/test-des.c: * tests/test-fclose.c, tests/test-fgetc.c, tests/test-filevercmp.c: * tests/test-fputc.c, tests/test-fread.c, tests/test-fwrite.c: * tests/test-gc-arcfour.c, tests/test-gc-arctwo.c, tests/test-gc-des.c: * tests/test-gc-hmac-md5.c, tests/test-gc-hmac-sha1.c: * tests/test-gc-md2.c, tests/test-gc-md4.c, tests/test-gc-md5.c: * tests/test-gc-pbkdf2-sha1.c, tests/test-gc-rijndael.c: * tests/test-gc-sha1.c, tests/test-gc.c, tests/test-getdelim.c: * tests/test-getline.c, tests/test-getndelim2.c, tests/test-md2.c: * tests/test-md4.c, tests/test-parse-datetime.c, tests/test-perror.c: * tests/test-perror2.c, tests/test-pipe.c, tests/test-pipe2.c: * tests/test-poll.c, tests/test-quotearg-simple.c: * tests/test-quotearg.c, tests/test-quotearg.h: * tests/test-round-ieee.c, tests/test-round1.c: * tests/test-roundf-ieee.c, tests/test-roundf1.c: * tests/test-roundl-ieee.c, tests/test-roundl.c: * tests/test-safe-alloc.c, tests/test-sigpipe.c: * tests/test-spawn-pipe-child.c, tests/test-spawn-pipe-main.c: * tests/test-strerror.c, tests/test-strerror_r.c: * tests/test-strsignal.c, tests/test-strverscmp.c: * tests/test-xmemdup0.c: Replace FSF snail mail addresses with URLs, as per GNU coding standards. See glibc bug <http://sourceware.org/bugzilla/show_bug.cgi?id=13673>.
* mktime: Avoid compilation error on Solaris 11.Bruno Haible2012-01-081-18/+20
| | | | * lib/mktime.c (WRAPV): Define to 0 on all non-glibc systems.
* In commentary, do not use ` to quote.Paul Eggert2012-01-051-3/+3
|
* maint: update all copyright year number rangesJim Meyering2012-01-011-1/+1
| | | | Run "make update-copyright".
* mktime: clarify long_int width checkingPaul Eggert2011-01-301-6/+5
| | | | | | | * lib/mktime.c (long_int_is_wide_enough): Move this assertion to the top level, to make it clearer that the assumption about long_int width is being checked. See <http://lists.gnu.org/archive/html/bug-gnulib/2011-01/msg00554.html>.
* TYPE_MAXIMUM: avoid theoretically undefined behaviorPaul Eggert2011-01-301-1/+1
| | | | | | | | | | | | | | * lib/intprops.h (TYPE_MINIMUM, TYPE_MAXIMUM): Do not shift a negative number, which the C Standard says has undefined behavior. In practice this is not a problem, but might as well do it by the book. Reported by Rich Felker and Eric Blake; see <http://lists.gnu.org/archive/html/bug-gnulib/2011-01/msg00493.html>. * lib/strtol.c (TYPE_MINIMUM, TYPE_MAXIMUM): Likewise. * m4/mktime.m4 (AC_FUNC_MKTIME): Likewise. * m4/nanosleep.m4 (gl_FUNC_NANOSLEEP): Likewise. * m4/parse-datetime.m4 (gl_PARSE_DATETIME): Likewise. * m4/stdint.m4 (gl_STDINT_H): Likewise. * lib/mktime.c (TYPE_MAXIMUM): Redo slightly to match the others.
* mktime: #undef mktime before #defining itPaul Eggert2011-01-291-0/+1
| | | | * lib/mktime.c (mktime) [DEBUG]: #undef mktime before #defining it.
* mktime: systematically normalize tm_isdst comparisonsPaul Eggert2011-01-291-6/+12
| | | | | | | | | * lib/mktime.c (isdst_differ): New function. (__mktime_internal): Use it systematically for all isdst comparisons. This completes the fix for libc BZ #6723, and removes the need for normalizing tm_isdst. See <http://sourceware.org/bugzilla/show_bug.cgi?id=6723> (not_equal_tm) [DEBUG]: Use isdst_differ here, too.
* mktime: fix some integer overflow issues and sidestep the restPaul Eggert2011-01-291-50/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was prompted by a bug report by Benjamin Lindner for MinGW <http://lists.gnu.org/archive/html/bug-gnulib/2011-01/msg00472.html>. His bug is due to signed integer overflow (0 - INT_MIN), and I I scanned through mktime.c looking for other integer overflow problems, fixing all the bugs I found. Although the C Standard says the resulting code is still not safe in the presence of integer overflow, in practice it should be good enough for all real-world two's-complement implementations, except for debugging environments that deliberately trap on integer overflow (e.g., gcc -ftrapv). * lib/mktime.c (WRAPV): New macro. (SHR): Also check that long_int and time_t shift right in the usual way, before using the fast-but-unportable method. (TYPE_ONES_COMPLEMENT, TYPE_SIGNED_MAGNITUDE): Remove, no longer used. The code already assumed two's complement, so there's no need to test for alternatives. All uses removed. (TYPE_MAXIMUM): Don't rely here on overflow behavior not defined by the C standard. Problem reported by Rich Felker in <http://lists.gnu.org/archive/html/bug-gnulib/2011-01/msg00488.html>. (twos_complement_arithmetic): Also check long_int and time_t. (time_t_avg, time_t_add_ok, time_t_int_add_ok): New functions. (guess_time_tm, ranged_convert, __mktime_internal): Use them. (__mktime_internal): Avoid integer overflow with unary subtraction in two instances where -1 - X is an adequate replacement for -X, since the calculations are approximate.
* mktime: avoid problems on NetBSD 5 / i386Paul Eggert2011-01-281-11/+14
| | | | | | | | | | * lib/mktime.c (long_int): New type. This works around a problem on NetBSD 5 / i386, where 'long int' and 'int' are both 32 bits but time_t is 64 bits, and where I expect the existing code is wrong in some cases. (leapyear, ydhms_diff, guess_time_tm, __mktime_internal): Use it. (ydhms_diff): Bring back the compile-time check for wide-enough year and yday.
* mktime: fix misspelling in commentPaul Eggert2011-01-281-1/+1
| | | | | * lib/mktime.c (__mktime_internal): Fix misspelling in comment. This merges all recent glibc changes of importance.
* maint: update almost all copyright ranges to include 2011Jim Meyering2011-01-011-1/+1
| | | | Run the new "make update-copyright" rule.
* update nearly all FSF copyright year lists to include 2010Jim Meyering2010-01-011-1/+1
| | | | | Use the same procedure as for 2009, outlined in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/20081
* Use spaces for indentation, not tabs.Bruno Haible2009-12-101-186/+186
|
* mktime, timegm: share common declarationEric Blake2009-11-021-3/+1
| | | | | | | | | | | * 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>
* build: avoid compiler warningsEric Blake2009-10-301-0/+3
| | | | | | | | | | | | * 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>
* Disable assertion that fails on NetBSD 5 / i386.Bruno Haible2009-09-171-1/+4
|
* mktime.c: normalize tp->tm_isdst value to -1/0/1.Ulrich Drepper2008-07-231-1/+3
| | | | | | * 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>.
* New module 'time', so that apps can include <time.h> as perPaul Eggert2007-02-121-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* autoupdateKarl Berry2006-09-111-2/+2
|
* * config/srclist.txt: Temporarily comment out mktime.c until glibc bugPaul Eggert2006-09-081-4/+5
| | | | | | | | | | | | | | | | | | | | | | | 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'.
* srclist.updateKarl Berry2005-09-181-2/+1
|
* * mktime.c: Include <string.h> even if !DEBUG. (From glibc.)Paul Eggert2005-06-231-13/+10
| | | | | | | | | (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.
* *** empty log message ***Paul Eggert2005-05-141-1/+1
|
* Propagate intprops.h comment fixes to mktime.c and strftime.c.Paul Eggert2005-03-261-3/+3
|
* * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,Paul Eggert2005-03-151-10/+20
| | | | | | TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from intprops.h. * strtol.c: Likewise.