aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/utils
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2012-08-23 12:29:03 +0200
committerBjörn Gustavsson <[email protected]>2012-08-27 09:29:02 +0200
commita6024f8d7786664378dae8814997405c6f795f3f (patch)
tree7be9640cd6fc5a06981a9e2a0484f600b436a9b5 /erts/emulator/utils
parente7720fe2b2a1f09af70e74b54442f72f84609a31 (diff)
downloadotp-a6024f8d7786664378dae8814997405c6f795f3f.tar.gz
otp-a6024f8d7786664378dae8814997405c6f795f3f.tar.bz2
otp-a6024f8d7786664378dae8814997405c6f795f3f.zip
make_preload: Don't fail if Perl's default file encoding is UTF-8
Setting Perl's default encoding for files to UTF-8, for example like this: PERL_UNICODE=DS make would crash the build with a message similar to: form size 1413 greater than size 1237 of module at utils/make_preload line 175, <FILE> chunk 1. Tell Perl to interpret the data in BEAM files as binary by using the binmode() function. The binmode() function existed before Unicode support was added to Perl, which means that make_preload should work even in old versions of Perl. Noticed-by: Aaron Harnly
Diffstat (limited to 'erts/emulator/utils')
-rwxr-xr-xerts/emulator/utils/make_preload1
1 files changed, 1 insertions, 0 deletions
diff --git a/erts/emulator/utils/make_preload b/erts/emulator/utils/make_preload
index 13019d4062..4e329b24f8 100755
--- a/erts/emulator/utils/make_preload
+++ b/erts/emulator/utils/make_preload
@@ -87,6 +87,7 @@ foreach $file (@ARGV) {
my $comment = '';
open(FILE, $file) or error("failed to read $file: $!");
+ binmode(FILE);
$_ = <FILE>;
$_ = beam_strip($_);
close(FILE);