diff options
author | Tim Sweetman <tim@aldigital.co.uk> | 2001-06-13 15:25:17 +0100 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-06-20 17:13:26 +0000 |
commit | 212caf55b8a7ec0d131ccbf5f587aaed741446df (patch) | |
tree | 9c3289975c880aa7b35c52e5f59f58102ccb5d65 /ext | |
parent | 97dcea33347a88fd451a9b2e4f27b9d77c268b94 (diff) | |
download | perl-212caf55b8a7ec0d131ccbf5f587aaed741446df.tar.gz |
Fix for [ID 20010124.001] POSIX::errno unreliable
Message-ID: <3B2769BD.68B4F4B3@aldigital.co.uk>
p4raw-id: //depot/perl@10756
Diffstat (limited to 'ext')
-rwxr-xr-x | ext/POSIX/POSIX.t | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/ext/POSIX/POSIX.t b/ext/POSIX/POSIX.t index cf08269f94..5bb6ab199d 100755 --- a/ext/POSIX/POSIX.t +++ b/ext/POSIX/POSIX.t @@ -10,11 +10,12 @@ BEGIN { } } -use POSIX qw(fcntl_h signal_h limits_h _exit getcwd open read strftime write); +use POSIX qw(fcntl_h signal_h limits_h _exit getcwd open read strftime write + errno); use strict subs; $| = 1; -print "1..27\n"; +print "1..29\n"; $Is_W32 = $^O eq 'MSWin32'; $Is_NetWare = $^O eq 'NetWare'; @@ -133,6 +134,20 @@ try_strftime(26, "Wed Mar 01 00:00:00 2000 061", 0,0,0, 1,2,100); try_strftime(27, "Fri Mar 31 00:00:00 2000 091", 0,0,0, 31,2,100); &POSIX::setlocale(&POSIX::LC_TIME, $lc) if $Config{d_setlocale}; +{ + for my $test (0, 1) { + $! = 0; + # POSIX::errno is autoloaded. + # Autoloading requires many system calls. + # errno() looks at $! to generate its result. + # Autoloading should not munge the value. + my $foo = $!; + my $errno = POSIX::errno(); + print "not " unless $errno == $foo; + print "ok ", 28 + $test, "\n"; + } +} + $| = 0; # The following line assumes buffered output, which may be not true with EMX: print '@#!*$@(!@#$' unless ($^O eq 'os2' || $^O eq 'uwin' || $^O eq 'os390' || |