Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 854867 Details for
Bug 1057047
perl Time::Local does not work with dates after 2038 or below 1902
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Fix ported from Time-Local-1.19
perl-5.8.8-64-bit-fix-for-Time-Local.patch (text/plain), 3.60 KB, created by
Petr Pisar
on 2014-01-24 09:49:34 UTC
(
hide
)
Description:
Fix ported from Time-Local-1.19
Filename:
MIME Type:
Creator:
Petr Pisar
Created:
2014-01-24 09:49:34 UTC
Size:
3.60 KB
patch
obsolete
>From 6c8f7507676266506da2942751262dcc29757e0a Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com> >Date: Fri, 24 Jan 2014 09:24:46 +0100 >Subject: [PATCH] 64-bit fix for Time::Local >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This allows Time::Local::timegm() to produce time values beyond year 2038 >on architectures with 64-bit time_t. 32-bit systems still suffer from the >limit. > >This is perl-5.8.8 back-port of Time-Local patch: > >commit 2f81742c01b843a54b75fb65476c2ace410d2b4a >Author: Dave Rolsky <autarch@urth.org> >Date: Sat Nov 1 16:50:57 2008 +0000 > > Use ivsize rather than intsize to determine maximum int size. This > lets us support 64-bit time_t properly. > > Removed a useless check of the year range. We already check the day > size to make sure it's in range, and this will catch years that are > too big. The year range check was arbitrary and didn't work with > 64-bit time_t. > >Similar code change has been merged into perl-5.11: > >commit d374f9c73e6118631558f80521fa3b0f1c61fb3a >Author: Jan Dubois <jand@activestate.com> >Date: Thu Dec 20 02:18:52 2007 -0800 > > 64-bit fix for Time::Local > From: "Jan Dubois" <jand@activestate.com> > Message-ID: <044301c84334$c6aa2960$53fe7c20$@com> > > p4raw-id: //depot/perl@32728 > ><https://rt.cpan.org/Public/Bug/Display.html?id=31497> ><https://bugzilla.redhat.com/show_bug.cgi?id=1057047> > >Signed-off-by: Petr PÃsaÅ <ppisar@redhat.com> >--- > lib/Time/Local.pm | 9 ++------- > lib/Time/Local.t | 12 ++++++++++++ > 2 files changed, 14 insertions(+), 7 deletions(-) > >diff --git a/lib/Time/Local.pm b/lib/Time/Local.pm >index 912f17d..199706f 100644 >--- a/lib/Time/Local.pm >+++ b/lib/Time/Local.pm >@@ -28,10 +28,10 @@ my ($MinInt, $MaxInt); > > if ($^O eq 'MacOS') { > # time_t is unsigned... >- $MaxInt = (1 << (8 * $Config{intsize})) - 1; >+ $MaxInt = (1 << (8 * $Config{ivsize})) - 1; > $MinInt = 0; > } else { >- $MaxInt = ((1 << (8 * $Config{intsize} - 2))-1)*2 + 1; >+ $MaxInt = ((1 << (8 * $Config{ivsize} - 2))-1)*2 + 1; > $MinInt = -$MaxInt - 1; > > # On Win32 (and others?) time_t appears to be signed, but negative >@@ -108,11 +108,6 @@ sub timegm { > } > > unless ($Options{no_range_check}) { >- if (abs($year) >= 0x7fff) { >- $year += 1900; >- croak "Cannot handle date ($sec, $min, $hour, $mday, $month, *$year*)"; >- } >- > croak "Month '$month' out of range 0..11" if $month > 11 or $month < 0; > > my $md = $MonthDays[$month]; >diff --git a/lib/Time/Local.t b/lib/Time/Local.t >index 288dcb6..73c3655 100755 >--- a/lib/Time/Local.t >+++ b/lib/Time/Local.t >@@ -64,12 +64,15 @@ if ($^O eq 'VMS') { > $neg_epoch_ok = 0; # time_t is unsigned > } > >+my $epoch_is_64 = eval { $Config{ivsize} == 8 && ( gmtime 2**40 )[5] == 34912 }; >+ > my $tests = (@time * 12); > $tests += @neg_time * 12; > $tests += @bad_time; > $tests += 8; > $tests += 2 if $ENV{PERL_CORE}; > $tests += 5 if $ENV{MAINTAINER}; >+$tests += 3 if $epoch_is_64; > > plan tests => $tests; > >@@ -168,6 +171,15 @@ if ($^O eq "aix" && $Config{osvers} =~ m/^4\.3\./) { > '0x7fffffff round trip through localtime then timelocal'); > } > >+if ($epoch_is_64) { >+ ok( timegm( 8, 14, 3, 19, 0, ( 1900 + 138 ) ), 2**31, >+ 'can call timegm for 2**31 epoch seconds' ); >+ ok( timegm( 16, 28, 6, 7, 1, ( 1900 + 206 ) ), 2**32, >+ 'can call timegm for 2**32 epoch seconds (on a 64-bit system)' ); >+ ok( timegm( 16, 36, 0, 20, 1, ( 34912 + 1900 ) ), 2**40, >+ 'can call timegm for 2**40 epoch seconds (on a 64-bit system)' ); >+} >+ > if ($ENV{MAINTAINER}) { > eval { require POSIX; POSIX::tzset() }; > if ($@) { >-- >1.8.5.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1057047
: 854867