From: Casey Tweten Date: Mon, 30 Oct 2000 15:51:17 +0000 (-0500) Subject: Use Errno magic. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=11d7f64f86584fefbeb7beb3792b3ccd34a45058;p=p5sagit%2Fp5-mst-13.2.git Use Errno magic. Subject: [ID 20001030.009] [PATCH] ftmp-mktemp failing Message-Id: <200010302051.e9UKpHd02194@ctweten.amsite.com> p4raw-id: //depot/perl@7494 --- diff --git a/lib/File/Temp.pm b/lib/File/Temp.pm index a351044..e3f8ff6 100644 --- a/lib/File/Temp.pm +++ b/lib/File/Temp.pm @@ -124,7 +124,7 @@ use Carp; use File::Spec 0.8; use File::Path qw/ rmtree /; use Fcntl 1.03; -use Errno qw( EEXIST ENOENT ENOTDIR EINVAL ); +use Errno; require VMS::Stdio if $^O eq 'VMS'; # Need the Symbol package if we are running older perl @@ -443,7 +443,7 @@ sub _gettemp { # Error opening file - abort with error # if the reason was anything but EEXIST - unless ($! == EEXIST) { + unless ($!{EEXIST}) { carp "File::Temp: Could not create temp file $path: $!"; return (); } @@ -473,7 +473,7 @@ sub _gettemp { # Abort with error if the reason for failure was anything # except EEXIST - unless ($! == EEXIST) { + unless ($!{EEXIST}) { carp "File::Temp: Could not create directory $path: $!"; return (); }