Fix breakages that prevended -DPERL_POISON from compiling.
[p5sagit/p5-mst-13.2.git] / lib / File / Path.pm
index 202bb48..5605735 100644 (file)
@@ -124,7 +124,7 @@ use Exporter ();
 use strict;
 use warnings;
 
-our $VERSION = "1.07_01";
+our $VERSION = "1.08";
 our @ISA = qw( Exporter );
 our @EXPORT = qw( mkpath rmtree );
 
@@ -174,7 +174,7 @@ sub mkpath {
        unless (mkdir($path,$mode)) {
            my $e = $!;
            # allow for another process to have created it meanwhile
-           croak ("mkdir $path: $e") unless -d $path;
+           $! = $e, croak ("mkdir $path: $e") unless -d $path;
        }
        push(@created, $path);
     }