In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/8177d4d97c5035e1ca045371b1be47a2ef66ec1d?hp=7214e7c31c99f51cf2858a0b68a932233248baf0>
- Log ----------------------------------------------------------------- commit 8177d4d97c5035e1ca045371b1be47a2ef66ec1d Author: Steve Hay <[email protected]> Date: Tue May 12 18:02:15 2009 +0100 Skip test for changing TZ if running in a pseudo-fork (on Win32) Changing $ENV{TZ} and calling tzset() is documented not to work on Win32 in any thread other than the main thread, which includes the emulated fork() on Win32 (used by cpantesters?). Mention fork() in the caveats and skip the test in this case. M ext/Time-Piece/Piece.pm M ext/Time-Piece/t/02core.t commit 5f320ac74440f7b17e30890d0ed2c920d7301549 Author: Steve Hay <[email protected]> Date: Tue May 12 17:57:35 2009 +0100 Upgrade to Time-Piece-1.14 M ext/Time-Piece/Changes M ext/Time-Piece/Piece.pm ----------------------------------------------------------------------- Summary of changes: ext/Time-Piece/Changes | 5 +++++ ext/Time-Piece/Piece.pm | 7 +++++-- ext/Time-Piece/t/02core.t | 8 +++++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ext/Time-Piece/Changes b/ext/Time-Piece/Changes index 88af255..d19d656 100644 --- a/ext/Time-Piece/Changes +++ b/ext/Time-Piece/Changes @@ -1,6 +1,11 @@ Time::Piece Changes +1.14 + - rework add_months() to not rely on strptime being able to parse illegal + dates (Gisle Aas). + - Various win32 TZ fixes from p5p core perl version + 1.13 - More QNX fixes ([email protected]) - Restore freebsd copyright on strptime. diff --git a/ext/Time-Piece/Piece.pm b/ext/Time-Piece/Piece.pm index 5320171..302114f 100644 --- a/ext/Time-Piece/Piece.pm +++ b/ext/Time-Piece/Piece.pm @@ -1,4 +1,4 @@ -# $Id: Piece.pm 76 2008-03-02 20:15:09Z matt $ +# $Id: Piece.pm 81 2009-05-09 02:31:43Z matt $ package Time::Piece; @@ -22,7 +22,7 @@ our %EXPORT_TAGS = ( ':override' => 'internal', ); -our $VERSION = '1.13_03'; +our $VERSION = '1.14_01'; bootstrap Time::Piece $VERSION; @@ -835,6 +835,9 @@ subsequently call that with the %Z formatting code. You must change $ENV{TZ} in the main thread to have the desired effect in this case (and you must also call _tzset() in the main thread to register the environment change). +Furthermore, remember that this caveat also applies to fork(), which is +emulated by threads on Win32. + =head1 AUTHOR Matt Sergeant, [email protected] diff --git a/ext/Time-Piece/t/02core.t b/ext/Time-Piece/t/02core.t index 7ca22a9..5610bcb 100644 --- a/ext/Time-Piece/t/02core.t +++ b/ext/Time-Piece/t/02core.t @@ -47,7 +47,13 @@ cmp_ok($t->datetime, 'eq','2000-02-29T12:34:56'); cmp_ok($t->daylight_savings, '==', 0); # ->tzoffset? -{ +my $is_pseudo_fork = 0; +if (defined &Win32::GetCurrentProcessId + ? $$ != Win32::GetCurrentProcessId() : $^O eq "MSWin32" && $$ < 0) { + $is_pseudo_fork = 1; +} +SKIP: { + skip "can't register TZ changes in a pseudo-fork", 2 if $is_pseudo_fork; local $ENV{TZ} = "EST5"; Time::Piece::_tzset(); # register the environment change my $lt = localtime; -- Perl5 Master Repository
