diff options
author | Nicholas Clark <nick@ccl4.org> | 2009-03-31 14:23:58 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2009-03-31 14:25:23 +0100 |
commit | cedab142c3511603d566403c134158cf036c418d (patch) | |
tree | 84c49810caaadc391f96a3b76177fe506376ca82 /ext/Errno | |
parent | 85a79b09b8bc5e91d2e64794fda42d63aa8f1f2f (diff) | |
download | perl-cedab142c3511603d566403c134158cf036c418d.tar.gz |
Don't create an empty Errno.pm if there is an error whilst running Errno_pm.PL
Implemented by initially writing to an temporary file name, and renaming as the
last act.
Diffstat (limited to 'ext/Errno')
-rw-r--r-- | ext/Errno/Errno_pm.PL | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL index 49e6a66ae6..424f0f3b4c 100644 --- a/ext/Errno/Errno_pm.PL +++ b/ext/Errno/Errno_pm.PL @@ -13,7 +13,8 @@ my $IsSymbian = exists $ENV{SDK} && -d "$ENV{SDK}\\epoc32"; my $IsMSWin32 = $^O eq 'MSWin32' && !$IsSymbian; unlink "Errno.pm" if -f "Errno.pm"; -open OUT, ">Errno.pm" or die "Cannot open Errno.pm: $!"; +unlink "Errno.tmp" if -f "Errno.tmp"; +open OUT, ">Errno.tmp" or die "Cannot open Errno.tmp: $!"; select OUT; my $file; my @files = get_files(); @@ -39,6 +40,7 @@ else { } write_errno_pm(); unlink "errno.c" if -f "errno.c"; +rename "Errno.tmp", "Errno.pm" or die "Cannot rename Errno.tmp to Errno.pm: $!"; sub process_file { my($file) = @_; |