New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PATCH] regen/regcomp.pl: close FH before unlink #16445
Comments
From @bulk88Created by @bulk88See attached patch. Perl Info
|
From @bulk880001-regen-regcomp.pl-close-FH-before-unlink.patchFrom 1d745974e0566d9c8e5d7dd3936e3585940d8e64 Mon Sep 17 00:00:00 2001
From: Daniel Dragan <bulk88@hotmail.com>
Date: Wed, 28 Feb 2018 19:42:19 -0500
Subject: [PATCH] regen/regcomp.pl: close FH before unlink
On Win32, regen.pl failed if something caused different checksum for
perldebguts.pod and the old file was attempted to be unlinked/renamed, but
that was failing because the FH is still open (Win32 specific thing).
So close the FH before renaming the file instead of having scope exit close
the FH after close_and_rename() executes.
the fixed error console log:
changed 'pod/perldebguts.pod-new' to 'pod/perldebguts.pod'
Couldn't unlink pod/perldebguts.pod: Permission denied
renaming pod/perldebguts.pod-new to pod/perldebguts.pod: Permission denied at ./
regen/regen_lib.pl line 120, <$oldguts> line 1046.
Changed: pod/perldebguts.pod
C:\perl\bin\perl.exe -I. regen/regcomp.pl -v failed: 3328 at regen.pl line 20, <
DATA> line 8.
---
regen/regcomp.pl | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/regen/regcomp.pl b/regen/regcomp.pl
index 88c0ac9..ffb7d7a 100644
--- a/regen/regcomp.pl
+++ b/regen/regcomp.pl
@@ -649,7 +649,8 @@ END_OF_DESCR
while (<$oldguts>) {
last if /=for regcomp.pl end/;
}
- do { print } while <$oldguts>;
+ do { print } while <$oldguts>; #win32 can't unlink an open FH
+ close $oldguts or die "Error closing pod/perldebguts.pod: $!";
select $old_fh;
close_and_rename($guts);
}
--
1.7.9.msysgit.0
|
The RT System itself - Status changed from 'new' to 'open' |
@tonycoz - Status changed from 'open' to 'pending release' |
From @khwilliamsonThank you for filing this report. You have helped make Perl better. With the release yesterday of Perl 5.28.0, this and 185 other issues have been Perl 5.28.0 may be downloaded via: If you find that the problem persists, feel free to reopen this ticket. |
@khwilliamson - Status changed from 'pending release' to 'resolved' |
Migrated from rt.perl.org#132924 (status was 'resolved')
Searchable as RT132924$
The text was updated successfully, but these errors were encountered: