summaryrefslogtreecommitdiff
path: root/opcode.pl
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-03-17 00:17:26 +0000
committerNicholas Clark <nick@ccl4.org>2008-03-17 00:17:26 +0000
commit08858ed21b9a4d448437bdae35df5c42fbe1c8bd (patch)
treed27bb2954cf830c9866eaa74e228a0a358b0d119 /opcode.pl
parent424a4936e3f61f4e8db394f496a116e698cede85 (diff)
downloadperl-08858ed21b9a4d448437bdae35df5c42fbe1c8bd.tar.gz
Drag autodoc.pl and overload.pl into the age of safer_open().
Thanks to the wisdom of london.pm, stuff the filename into the SCALAR slot of the typeglob created in safer_open(), so that ... Add safer_close(), that will die (with the filename) if the close fails. p4raw-id: //depot/perl@33539
Diffstat (limited to 'opcode.pl')
-rwxr-xr-xopcode.pl8
1 files changed, 4 insertions, 4 deletions
diff --git a/opcode.pl b/opcode.pl
index 08c9e8327f..7f88036ea3 100755
--- a/opcode.pl
+++ b/opcode.pl
@@ -438,8 +438,8 @@ sub gen_op_is_macro {
print $oc "/* ex: set ro: */\n";
print $on "/* ex: set ro: */\n";
-close $oc or die "Error closing $opcode_new: $!\n";
-close $on or die "Error closing $opname_new: $!\n";
+safer_close($oc);
+safer_close($on);
rename_if_different $opcode_new, 'opcode.h';
rename_if_different $opname_new, 'opnames.h';
@@ -487,8 +487,8 @@ for (@ops) {
print $pp "\n/* ex: set ro: */\n";
print $ppsym "\n# ex: set ro:\n";
-close $pp or die "Error closing pp_proto.h-new: $!\n";
-close $ppsym or die "Error closing pp.sym-new: $!\n";
+safer_close($pp);
+safer_close($ppsym);
rename_if_different $pp_proto_new, 'pp_proto.h';
rename_if_different $pp_sym_new, 'pp.sym';