[openssl] OpenSSL_1_1_1-stable update
Dr. Paul Dale
pauli at openssl.org
Mon Feb 17 02:22:03 UTC 2020
The branch OpenSSL_1_1_1-stable has been updated
via 218e740f850f77c9f2720d56886eab166d1a6727 (commit)
from 57225c99ef848f0d0d1a7ab586a61ef71740f1ff (commit)
- Log -----------------------------------------------------------------
commit 218e740f850f77c9f2720d56886eab166d1a6727
Author: David Benjamin <davidben at google.com>
Date: Mon Feb 17 12:21:27 2020 +1000
Do not silently truncate files on perlasm errors
If one of the perlasm xlate drivers crashes, OpenSSL's build will
currently swallow the error and silently truncate the output to however
far the driver got. This will hopefully fail to build, but better to
check such things.
Handle this by checking for errors when closing STDOUT (which is a pipe
to the xlate driver).
This is the OpenSSL 1.1.1 version of
https://github.com/openssl/openssl/pull/10883 and
https://github.com/openssl/openssl/pull/10930.
Reviewed-by: Mark J. Cox <mark at awe.com>
Reviewed-by: Paul Dale David Benjamin <davidben at google.com>
(Merged from https://github.com/openssl/openssl/pull/10931)
-----------------------------------------------------------------------
Summary of changes:
crypto/aes/asm/aes-armv4.pl | 2 +-
crypto/aes/asm/aes-c64xplus.pl | 2 +-
crypto/aes/asm/aes-mips.pl | 2 +-
crypto/aes/asm/aes-parisc.pl | 2 +-
crypto/aes/asm/aes-ppc.pl | 2 +-
crypto/aes/asm/aes-s390x.pl | 2 +-
crypto/aes/asm/aes-sparcv9.pl | 2 +-
crypto/aes/asm/aesfx-sparcv9.pl | 2 +-
crypto/aes/asm/aesni-mb-x86_64.pl | 2 +-
crypto/aes/asm/aesni-sha1-x86_64.pl | 2 +-
crypto/aes/asm/aesni-sha256-x86_64.pl | 2 +-
crypto/aes/asm/aesni-x86.pl | 2 +-
crypto/aes/asm/aesni-x86_64.pl | 2 +-
crypto/aes/asm/aesp8-ppc.pl | 2 +-
crypto/aes/asm/aest4-sparcv9.pl | 2 +-
crypto/aes/asm/aesv8-armx.pl | 2 +-
crypto/aes/asm/bsaes-armv7.pl | 2 +-
crypto/aes/asm/vpaes-armv8.pl | 2 +-
crypto/aes/asm/vpaes-ppc.pl | 2 +-
crypto/aes/asm/vpaes-x86.pl | 2 +-
crypto/aes/asm/vpaes-x86_64.pl | 2 +-
crypto/alphacpuid.pl | 2 +-
crypto/arm64cpuid.pl | 2 +-
crypto/armv4cpuid.pl | 2 +-
crypto/bf/asm/bf-586.pl | 2 +-
crypto/bn/asm/alpha-mont.pl | 2 +-
crypto/bn/asm/armv4-gf2m.pl | 2 +-
crypto/bn/asm/armv4-mont.pl | 2 +-
crypto/bn/asm/armv8-mont.pl | 2 +-
crypto/bn/asm/bn-586.pl | 2 +-
crypto/bn/asm/c64xplus-gf2m.pl | 2 +-
crypto/bn/asm/co-586.pl | 2 +-
crypto/bn/asm/ia64-mont.pl | 2 +-
crypto/bn/asm/mips-mont.pl | 2 +-
crypto/bn/asm/mips.pl | 2 +-
crypto/bn/asm/parisc-mont.pl | 2 +-
crypto/bn/asm/ppc-mont.pl | 2 +-
crypto/bn/asm/ppc.pl | 2 +-
crypto/bn/asm/ppc64-mont.pl | 2 +-
crypto/bn/asm/rsaz-avx2.pl | 2 +-
crypto/bn/asm/rsaz-x86_64.pl | 2 +-
crypto/bn/asm/s390x-gf2m.pl | 2 +-
crypto/bn/asm/s390x-mont.pl | 2 +-
crypto/bn/asm/sparct4-mont.pl | 2 +-
crypto/bn/asm/sparcv9-gf2m.pl | 2 +-
crypto/bn/asm/sparcv9-mont.pl | 2 +-
crypto/bn/asm/sparcv9a-mont.pl | 2 +-
crypto/bn/asm/via-mont.pl | 2 +-
crypto/bn/asm/vis3-mont.pl | 2 +-
crypto/bn/asm/x86-gf2m.pl | 2 +-
crypto/bn/asm/x86-mont.pl | 2 +-
crypto/bn/asm/x86_64-gf2m.pl | 2 +-
crypto/bn/asm/x86_64-mont.pl | 2 +-
crypto/bn/asm/x86_64-mont5.pl | 2 +-
crypto/c64xpluscpuid.pl | 2 +-
crypto/camellia/asm/cmll-x86.pl | 2 +-
crypto/camellia/asm/cmll-x86_64.pl | 2 +-
crypto/camellia/asm/cmllt4-sparcv9.pl | 2 +-
crypto/cast/asm/cast-586.pl | 2 +-
crypto/chacha/asm/chacha-armv4.pl | 2 +-
crypto/chacha/asm/chacha-armv8.pl | 2 +-
crypto/chacha/asm/chacha-c64xplus.pl | 2 +-
crypto/chacha/asm/chacha-ppc.pl | 2 +-
crypto/chacha/asm/chacha-s390x.pl | 2 +-
crypto/chacha/asm/chacha-x86.pl | 2 +-
crypto/chacha/asm/chacha-x86_64.pl | 2 +-
crypto/des/asm/crypt586.pl | 2 +-
crypto/des/asm/des-586.pl | 2 +-
crypto/des/asm/dest4-sparcv9.pl | 2 +-
crypto/ec/asm/ecp_nistz256-armv4.pl | 2 +-
crypto/ec/asm/ecp_nistz256-armv8.pl | 2 +-
crypto/ec/asm/ecp_nistz256-avx2.pl | 2 +-
crypto/ec/asm/ecp_nistz256-ppc64.pl | 2 +-
crypto/ec/asm/ecp_nistz256-sparcv9.pl | 2 +-
crypto/ec/asm/ecp_nistz256-x86.pl | 2 +-
crypto/ec/asm/ecp_nistz256-x86_64.pl | 2 +-
crypto/ec/asm/x25519-ppc64.pl | 2 +-
crypto/ec/asm/x25519-x86_64.pl | 2 +-
crypto/md5/asm/md5-586.pl | 2 +-
crypto/md5/asm/md5-sparcv9.pl | 2 +-
crypto/md5/asm/md5-x86_64.pl | 2 +-
crypto/modes/asm/aesni-gcm-x86_64.pl | 2 +-
crypto/modes/asm/ghash-alpha.pl | 2 +-
crypto/modes/asm/ghash-armv4.pl | 2 +-
crypto/modes/asm/ghash-c64xplus.pl | 2 +-
crypto/modes/asm/ghash-ia64.pl | 2 +-
crypto/modes/asm/ghash-parisc.pl | 2 +-
crypto/modes/asm/ghash-s390x.pl | 2 +-
crypto/modes/asm/ghash-sparcv9.pl | 2 +-
crypto/modes/asm/ghash-x86.pl | 2 +-
crypto/modes/asm/ghash-x86_64.pl | 2 +-
crypto/modes/asm/ghashp8-ppc.pl | 2 +-
crypto/modes/asm/ghashv8-armx.pl | 2 +-
crypto/pariscid.pl | 2 +-
crypto/perlasm/arm-xlate.pl | 2 +-
crypto/perlasm/ppc-xlate.pl | 2 +-
crypto/perlasm/x86_64-xlate.pl | 2 +-
crypto/poly1305/asm/poly1305-armv4.pl | 2 +-
crypto/poly1305/asm/poly1305-armv8.pl | 2 +-
crypto/poly1305/asm/poly1305-mips.pl | 2 +-
crypto/poly1305/asm/poly1305-ppc.pl | 2 +-
crypto/poly1305/asm/poly1305-ppcfp.pl | 2 +-
crypto/poly1305/asm/poly1305-s390x.pl | 2 +-
crypto/poly1305/asm/poly1305-sparcv9.pl | 2 +-
crypto/poly1305/asm/poly1305-x86.pl | 2 +-
crypto/poly1305/asm/poly1305-x86_64.pl | 2 +-
crypto/ppccpuid.pl | 2 +-
crypto/rc4/asm/rc4-586.pl | 2 +-
crypto/rc4/asm/rc4-c64xplus.pl | 2 +-
crypto/rc4/asm/rc4-md5-x86_64.pl | 2 +-
crypto/rc4/asm/rc4-parisc.pl | 2 +-
crypto/rc4/asm/rc4-s390x.pl | 2 +-
crypto/rc4/asm/rc4-x86_64.pl | 2 +-
crypto/rc5/asm/rc5-586.pl | 2 +-
crypto/ripemd/asm/rmd-586.pl | 2 +-
crypto/s390xcpuid.pl | 2 +-
crypto/sha/asm/keccak1600-armv4.pl | 2 +-
crypto/sha/asm/keccak1600-armv8.pl | 2 +-
crypto/sha/asm/keccak1600-avx2.pl | 2 +-
crypto/sha/asm/keccak1600-avx512.pl | 2 +-
crypto/sha/asm/keccak1600-avx512vl.pl | 2 +-
crypto/sha/asm/keccak1600-c64x.pl | 2 +-
crypto/sha/asm/keccak1600-mmx.pl | 2 +-
crypto/sha/asm/keccak1600-ppc64.pl | 2 +-
crypto/sha/asm/keccak1600-s390x.pl | 2 +-
crypto/sha/asm/keccak1600-x86_64.pl | 2 +-
crypto/sha/asm/keccak1600p8-ppc.pl | 2 +-
crypto/sha/asm/sha1-586.pl | 2 +-
crypto/sha/asm/sha1-alpha.pl | 2 +-
crypto/sha/asm/sha1-armv4-large.pl | 2 +-
crypto/sha/asm/sha1-armv8.pl | 2 +-
crypto/sha/asm/sha1-c64xplus.pl | 2 +-
crypto/sha/asm/sha1-mb-x86_64.pl | 2 +-
crypto/sha/asm/sha1-mips.pl | 2 +-
crypto/sha/asm/sha1-parisc.pl | 2 +-
crypto/sha/asm/sha1-ppc.pl | 2 +-
crypto/sha/asm/sha1-s390x.pl | 2 +-
crypto/sha/asm/sha1-sparcv9.pl | 2 +-
crypto/sha/asm/sha1-sparcv9a.pl | 2 +-
crypto/sha/asm/sha1-thumb.pl | 2 +-
crypto/sha/asm/sha1-x86_64.pl | 2 +-
crypto/sha/asm/sha256-586.pl | 2 +-
crypto/sha/asm/sha256-armv4.pl | 2 +-
crypto/sha/asm/sha256-c64xplus.pl | 2 +-
crypto/sha/asm/sha256-mb-x86_64.pl | 2 +-
crypto/sha/asm/sha512-586.pl | 2 +-
crypto/sha/asm/sha512-armv4.pl | 2 +-
crypto/sha/asm/sha512-armv8.pl | 2 +-
crypto/sha/asm/sha512-c64xplus.pl | 2 +-
crypto/sha/asm/sha512-mips.pl | 2 +-
crypto/sha/asm/sha512-parisc.pl | 2 +-
crypto/sha/asm/sha512-ppc.pl | 2 +-
crypto/sha/asm/sha512-s390x.pl | 2 +-
crypto/sha/asm/sha512-sparcv9.pl | 2 +-
crypto/sha/asm/sha512-x86_64.pl | 2 +-
crypto/sha/asm/sha512p8-ppc.pl | 2 +-
crypto/whrlpool/asm/wp-mmx.pl | 2 +-
crypto/whrlpool/asm/wp-x86_64.pl | 2 +-
crypto/x86_64cpuid.pl | 2 +-
crypto/x86cpuid.pl | 2 +-
160 files changed, 160 insertions(+), 160 deletions(-)
diff --git a/crypto/aes/asm/aes-armv4.pl b/crypto/aes/asm/aes-armv4.pl
index 998158998e..0a9d45a31b 100644
--- a/crypto/aes/asm/aes-armv4.pl
+++ b/crypto/aes/asm/aes-armv4.pl
@@ -1242,4 +1242,4 @@ while(<SELF>) {
close SELF;
print $code;
-close STDOUT; # enforce flush
+close STDOUT or die "error closing STDOUT: $!"; # enforce flush
diff --git a/crypto/aes/asm/aes-c64xplus.pl b/crypto/aes/asm/aes-c64xplus.pl
index 19d2cc176f..a4a863fb1e 100644
--- a/crypto/aes/asm/aes-c64xplus.pl
+++ b/crypto/aes/asm/aes-c64xplus.pl
@@ -1379,4 +1379,4 @@ AES_Td4:
___
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/aes/asm/aes-mips.pl b/crypto/aes/asm/aes-mips.pl
index 716c3356ea..54c70ed1ee 100644
--- a/crypto/aes/asm/aes-mips.pl
+++ b/crypto/aes/asm/aes-mips.pl
@@ -2167,4 +2167,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/aes/asm/aes-parisc.pl b/crypto/aes/asm/aes-parisc.pl
index e817c757f8..1229ec6a2f 100644
--- a/crypto/aes/asm/aes-parisc.pl
+++ b/crypto/aes/asm/aes-parisc.pl
@@ -1035,4 +1035,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/aes/asm/aes-ppc.pl b/crypto/aes/asm/aes-ppc.pl
index ca69df4c3e..d017b5064d 100644
--- a/crypto/aes/asm/aes-ppc.pl
+++ b/crypto/aes/asm/aes-ppc.pl
@@ -1456,4 +1456,4 @@ ___
$code =~ s/\`([^\`]*)\`/eval $1/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/aes/asm/aes-s390x.pl b/crypto/aes/asm/aes-s390x.pl
index 815fde8fcd..cf748f102a 100644
--- a/crypto/aes/asm/aes-s390x.pl
+++ b/crypto/aes/asm/aes-s390x.pl
@@ -2279,4 +2279,4 @@ ___
$code =~ s/\`([^\`]*)\`/eval $1/gem;
print $code;
-close STDOUT; # force flush
+close STDOUT or die "error closing STDOUT: $!"; # force flush
diff --git a/crypto/aes/asm/aes-sparcv9.pl b/crypto/aes/asm/aes-sparcv9.pl
index 40d1f94ccd..7e2e1e4216 100755
--- a/crypto/aes/asm/aes-sparcv9.pl
+++ b/crypto/aes/asm/aes-sparcv9.pl
@@ -1189,4 +1189,4 @@ ___
$code =~ s/fmovs.*$//gm;
print $code;
-close STDOUT; # ensure flush
+close STDOUT or die "error closing STDOUT: $!"; # ensure flush
diff --git a/crypto/aes/asm/aesfx-sparcv9.pl b/crypto/aes/asm/aesfx-sparcv9.pl
index 9ddf0b4b00..422bb54ba8 100644
--- a/crypto/aes/asm/aesfx-sparcv9.pl
+++ b/crypto/aes/asm/aesfx-sparcv9.pl
@@ -1267,4 +1267,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/aes/asm/aesni-mb-x86_64.pl b/crypto/aes/asm/aesni-mb-x86_64.pl
index 243ece462f..66630311e2 100644
--- a/crypto/aes/asm/aesni-mb-x86_64.pl
+++ b/crypto/aes/asm/aesni-mb-x86_64.pl
@@ -1471,4 +1471,4 @@ $code =~ s/\`([^\`]*)\`/eval($1)/gem;
$code =~ s/\b(aes.*%xmm[0-9]+).*$/aesni($1)/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/aes/asm/aesni-sha1-x86_64.pl b/crypto/aes/asm/aesni-sha1-x86_64.pl
index 50e6ed637e..c90429d8e4 100644
--- a/crypto/aes/asm/aesni-sha1-x86_64.pl
+++ b/crypto/aes/asm/aesni-sha1-x86_64.pl
@@ -2143,4 +2143,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/aes/asm/aesni-sha256-x86_64.pl b/crypto/aes/asm/aesni-sha256-x86_64.pl
index c361f339ea..a811bbc821 100644
--- a/crypto/aes/asm/aesni-sha256-x86_64.pl
+++ b/crypto/aes/asm/aesni-sha256-x86_64.pl
@@ -1799,4 +1799,4 @@ sub rex {
$code =~ s/\`([^\`]*)\`/eval $1/gem;
$code =~ s/\b(sha256[^\s]*)\s+(.*)/sha256op38($1,$2)/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/aes/asm/aesni-x86.pl b/crypto/aes/asm/aesni-x86.pl
index b351fca28e..4240b9445b 100644
--- a/crypto/aes/asm/aesni-x86.pl
+++ b/crypto/aes/asm/aesni-x86.pl
@@ -3412,4 +3412,4 @@ my ($l_,$block,$i1,$i3,$i5) = ($rounds_,$key_,$rounds,$len,$out);
&asm_finish();
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/aes/asm/aesni-x86_64.pl b/crypto/aes/asm/aesni-x86_64.pl
index 5807f4eff7..dfedf6d758 100644
--- a/crypto/aes/asm/aesni-x86_64.pl
+++ b/crypto/aes/asm/aesni-x86_64.pl
@@ -5154,4 +5154,4 @@ $code =~ s/\bmovbe\s+%eax,\s*([0-9]+)\(%rsp\)/movbe($1)/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/aes/asm/aesp8-ppc.pl b/crypto/aes/asm/aesp8-ppc.pl
index c0da1b84aa..d8a46253e5 100755
--- a/crypto/aes/asm/aesp8-ppc.pl
+++ b/crypto/aes/asm/aesp8-ppc.pl
@@ -3804,4 +3804,4 @@ foreach(split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/aes/asm/aest4-sparcv9.pl b/crypto/aes/asm/aest4-sparcv9.pl
index 54d0c58821..5260a34671 100644
--- a/crypto/aes/asm/aest4-sparcv9.pl
+++ b/crypto/aes/asm/aest4-sparcv9.pl
@@ -926,4 +926,4 @@ ___
&emit_assembler();
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/aes/asm/aesv8-armx.pl b/crypto/aes/asm/aesv8-armx.pl
index eec0ed230a..d515a5fc1d 100755
--- a/crypto/aes/asm/aesv8-armx.pl
+++ b/crypto/aes/asm/aesv8-armx.pl
@@ -1008,4 +1008,4 @@ if ($flavour =~ /64/) { ######## 64-bit code
}
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/aes/asm/bsaes-armv7.pl b/crypto/aes/asm/bsaes-armv7.pl
index bfe825af0d..6f4aeb2e5c 100644
--- a/crypto/aes/asm/bsaes-armv7.pl
+++ b/crypto/aes/asm/bsaes-armv7.pl
@@ -2488,4 +2488,4 @@ close SELF;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/aes/asm/vpaes-armv8.pl b/crypto/aes/asm/vpaes-armv8.pl
index e38288af55..84b7ba046d 100755
--- a/crypto/aes/asm/vpaes-armv8.pl
+++ b/crypto/aes/asm/vpaes-armv8.pl
@@ -1274,4 +1274,4 @@ ___
} }
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/aes/asm/vpaes-ppc.pl b/crypto/aes/asm/vpaes-ppc.pl
index 3c771a7e98..4469eaba3d 100644
--- a/crypto/aes/asm/vpaes-ppc.pl
+++ b/crypto/aes/asm/vpaes-ppc.pl
@@ -1591,4 +1591,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/aes/asm/vpaes-x86.pl b/crypto/aes/asm/vpaes-x86.pl
index 7d57edc0eb..bdebe6628f 100644
--- a/crypto/aes/asm/vpaes-x86.pl
+++ b/crypto/aes/asm/vpaes-x86.pl
@@ -913,4 +913,4 @@ $k_dsbo=0x2c0; # decryption sbox final output
&asm_finish();
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/aes/asm/vpaes-x86_64.pl b/crypto/aes/asm/vpaes-x86_64.pl
index 33d293e623..2b469b55a1 100644
--- a/crypto/aes/asm/vpaes-x86_64.pl
+++ b/crypto/aes/asm/vpaes-x86_64.pl
@@ -1238,4 +1238,4 @@ $code =~ s/\`([^\`]*)\`/eval($1)/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/alphacpuid.pl b/crypto/alphacpuid.pl
index 6c7fd4c9dd..8144555e0e 100644
--- a/crypto/alphacpuid.pl
+++ b/crypto/alphacpuid.pl
@@ -254,4 +254,4 @@ OPENSSL_instrument_bus2:
___
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/arm64cpuid.pl b/crypto/arm64cpuid.pl
index 06c8add7a0..397b00f873 100755
--- a/crypto/arm64cpuid.pl
+++ b/crypto/arm64cpuid.pl
@@ -144,4 +144,4 @@ CRYPTO_memcmp:
___
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/armv4cpuid.pl b/crypto/armv4cpuid.pl
index ab007c19c3..9619a4f4b0 100644
--- a/crypto/armv4cpuid.pl
+++ b/crypto/armv4cpuid.pl
@@ -293,4 +293,4 @@ atomic_add_spinlock:
___
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/bf/asm/bf-586.pl b/crypto/bf/asm/bf-586.pl
index 4e913aecf4..982d2780b5 100644
--- a/crypto/bf/asm/bf-586.pl
+++ b/crypto/bf/asm/bf-586.pl
@@ -32,7 +32,7 @@ $tmp4="edx";
&cbc("BF_cbc_encrypt","BF_encrypt","BF_decrypt",1,4,5,3,-1,-1);
&asm_finish();
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
sub BF_encrypt
{
diff --git a/crypto/bn/asm/alpha-mont.pl b/crypto/bn/asm/alpha-mont.pl
index c9b962a150..efd724ce97 100644
--- a/crypto/bn/asm/alpha-mont.pl
+++ b/crypto/bn/asm/alpha-mont.pl
@@ -325,4 +325,4 @@ bn_mul_mont:
___
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/bn/asm/armv4-gf2m.pl b/crypto/bn/asm/armv4-gf2m.pl
index 7a0cdb2e8a..62450617b1 100644
--- a/crypto/bn/asm/armv4-gf2m.pl
+++ b/crypto/bn/asm/armv4-gf2m.pl
@@ -329,4 +329,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT; # enforce flush
+close STDOUT or die "error closing STDOUT: $!"; # enforce flush
diff --git a/crypto/bn/asm/armv4-mont.pl b/crypto/bn/asm/armv4-mont.pl
index 6bedc62ba6..c74967511c 100644
--- a/crypto/bn/asm/armv4-mont.pl
+++ b/crypto/bn/asm/armv4-mont.pl
@@ -754,4 +754,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/bn/asm/armv8-mont.pl b/crypto/bn/asm/armv8-mont.pl
index d8347bf932..333c5ea9c2 100755
--- a/crypto/bn/asm/armv8-mont.pl
+++ b/crypto/bn/asm/armv8-mont.pl
@@ -1511,4 +1511,4 @@ ___
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/bn/asm/bn-586.pl b/crypto/bn/asm/bn-586.pl
index 58effc8808..41974738bf 100644
--- a/crypto/bn/asm/bn-586.pl
+++ b/crypto/bn/asm/bn-586.pl
@@ -31,7 +31,7 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
&asm_finish();
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
sub bn_mul_add_words
{
diff --git a/crypto/bn/asm/c64xplus-gf2m.pl b/crypto/bn/asm/c64xplus-gf2m.pl
index 9c46da3af8..f077b39777 100644
--- a/crypto/bn/asm/c64xplus-gf2m.pl
+++ b/crypto/bn/asm/c64xplus-gf2m.pl
@@ -157,4 +157,4 @@ $code.=<<___;
___
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/bn/asm/co-586.pl b/crypto/bn/asm/co-586.pl
index 64648c9192..5a0a1533a3 100644
--- a/crypto/bn/asm/co-586.pl
+++ b/crypto/bn/asm/co-586.pl
@@ -22,7 +22,7 @@ open STDOUT,">$output";
&asm_finish();
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
sub mul_add_c
{
diff --git a/crypto/bn/asm/ia64-mont.pl b/crypto/bn/asm/ia64-mont.pl
index ec486f7779..3071a675f6 100644
--- a/crypto/bn/asm/ia64-mont.pl
+++ b/crypto/bn/asm/ia64-mont.pl
@@ -857,4 +857,4 @@ ___
open STDOUT,">$output" if $output;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/bn/asm/mips-mont.pl b/crypto/bn/asm/mips-mont.pl
index fbe5d04f71..3998ef81fb 100644
--- a/crypto/bn/asm/mips-mont.pl
+++ b/crypto/bn/asm/mips-mont.pl
@@ -430,4 +430,4 @@ ___
$code =~ s/\`([^\`]*)\`/eval $1/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/bn/asm/mips.pl b/crypto/bn/asm/mips.pl
index a205189eb6..12a293c43b 100644
--- a/crypto/bn/asm/mips.pl
+++ b/crypto/bn/asm/mips.pl
@@ -2260,4 +2260,4 @@ $code.=<<___;
.end bn_sqr_comba4
___
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/bn/asm/parisc-mont.pl b/crypto/bn/asm/parisc-mont.pl
index aa9f626ed2..002ec96dbc 100644
--- a/crypto/bn/asm/parisc-mont.pl
+++ b/crypto/bn/asm/parisc-mont.pl
@@ -1003,4 +1003,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/bn/asm/ppc-mont.pl b/crypto/bn/asm/ppc-mont.pl
index ec7e019a43..a997472e84 100644
--- a/crypto/bn/asm/ppc-mont.pl
+++ b/crypto/bn/asm/ppc-mont.pl
@@ -1987,4 +1987,4 @@ ___
$code =~ s/\`([^\`]*)\`/eval $1/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/bn/asm/ppc.pl b/crypto/bn/asm/ppc.pl
index d6d4e66f92..03481c28c8 100644
--- a/crypto/bn/asm/ppc.pl
+++ b/crypto/bn/asm/ppc.pl
@@ -2009,4 +2009,4 @@ Lppcasm_maw_adios:
EOF
$data =~ s/\`([^\`]*)\`/eval $1/gem;
print $data;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/bn/asm/ppc64-mont.pl b/crypto/bn/asm/ppc64-mont.pl
index c41b620bc2..e2b62f4dac 100644
--- a/crypto/bn/asm/ppc64-mont.pl
+++ b/crypto/bn/asm/ppc64-mont.pl
@@ -1649,4 +1649,4 @@ ___
$code =~ s/\`([^\`]*)\`/eval $1/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/bn/asm/rsaz-avx2.pl b/crypto/bn/asm/rsaz-avx2.pl
index ec66e2565c..fca4cd110b 100755
--- a/crypto/bn/asm/rsaz-avx2.pl
+++ b/crypto/bn/asm/rsaz-avx2.pl
@@ -1979,4 +1979,4 @@ rsaz_1024_gather5_avx2:
___
}}}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/bn/asm/rsaz-x86_64.pl b/crypto/bn/asm/rsaz-x86_64.pl
index ac21676d8d..3b92a423aa 100755
--- a/crypto/bn/asm/rsaz-x86_64.pl
+++ b/crypto/bn/asm/rsaz-x86_64.pl
@@ -2428,4 +2428,4 @@ ___
$code =~ s/\`([^\`]*)\`/eval $1/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/bn/asm/s390x-gf2m.pl b/crypto/bn/asm/s390x-gf2m.pl
index 06181bf9b9..75bf91817b 100644
--- a/crypto/bn/asm/s390x-gf2m.pl
+++ b/crypto/bn/asm/s390x-gf2m.pl
@@ -225,4 +225,4 @@ ___
$code =~ s/\`([^\`]*)\`/eval($1)/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/bn/asm/s390x-mont.pl b/crypto/bn/asm/s390x-mont.pl
index 21b935a962..689d249cca 100644
--- a/crypto/bn/asm/s390x-mont.pl
+++ b/crypto/bn/asm/s390x-mont.pl
@@ -281,4 +281,4 @@ foreach (split("\n",$code)) {
s/_dswap\s+(%r[0-9]+)/sprintf("rllg\t%s,%s,32",$1,$1) if($SIZE_T==4)/e;
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/bn/asm/sparct4-mont.pl b/crypto/bn/asm/sparct4-mont.pl
index fcae9cfc5b..b3cf02a515 100755
--- a/crypto/bn/asm/sparct4-mont.pl
+++ b/crypto/bn/asm/sparct4-mont.pl
@@ -1225,4 +1225,4 @@ ___
&emit_assembler();
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/bn/asm/sparcv9-gf2m.pl b/crypto/bn/asm/sparcv9-gf2m.pl
index dcf11a87a1..09471d4f60 100644
--- a/crypto/bn/asm/sparcv9-gf2m.pl
+++ b/crypto/bn/asm/sparcv9-gf2m.pl
@@ -197,4 +197,4 @@ ___
$code =~ s/\`([^\`]*)\`/eval($1)/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/bn/asm/sparcv9-mont.pl b/crypto/bn/asm/sparcv9-mont.pl
index b41903af98..598839b6e3 100644
--- a/crypto/bn/asm/sparcv9-mont.pl
+++ b/crypto/bn/asm/sparcv9-mont.pl
@@ -617,4 +617,4 @@ $code.=<<___;
___
$code =~ s/\`([^\`]*)\`/eval($1)/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/bn/asm/sparcv9a-mont.pl b/crypto/bn/asm/sparcv9a-mont.pl
index c8f759df9f..72df364764 100755
--- a/crypto/bn/asm/sparcv9a-mont.pl
+++ b/crypto/bn/asm/sparcv9a-mont.pl
@@ -884,4 +884,4 @@ $code =~ s/fzeros\s+%f([0-9]+)/
print $code;
# flush
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/bn/asm/via-mont.pl b/crypto/bn/asm/via-mont.pl
index 9cf717e841..c836019c5f 100644
--- a/crypto/bn/asm/via-mont.pl
+++ b/crypto/bn/asm/via-mont.pl
@@ -248,4 +248,4 @@ $sp=&DWP(28,"esp");
&asm_finish();
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/bn/asm/vis3-mont.pl b/crypto/bn/asm/vis3-mont.pl
index 04833a0c87..826bb941f4 100644
--- a/crypto/bn/asm/vis3-mont.pl
+++ b/crypto/bn/asm/vis3-mont.pl
@@ -381,4 +381,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/bn/asm/x86-gf2m.pl b/crypto/bn/asm/x86-gf2m.pl
index d03efcc750..907062c618 100644
--- a/crypto/bn/asm/x86-gf2m.pl
+++ b/crypto/bn/asm/x86-gf2m.pl
@@ -322,4 +322,4 @@ if ($sse2) {
&asm_finish();
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/bn/asm/x86-mont.pl b/crypto/bn/asm/x86-mont.pl
index 7ba2133ac9..a09c5368f2 100755
--- a/crypto/bn/asm/x86-mont.pl
+++ b/crypto/bn/asm/x86-mont.pl
@@ -628,4 +628,4 @@ $sbit=$num;
&asm_finish();
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/bn/asm/x86_64-gf2m.pl b/crypto/bn/asm/x86_64-gf2m.pl
index 0fd6e985d7..84ca2f1b93 100644
--- a/crypto/bn/asm/x86_64-gf2m.pl
+++ b/crypto/bn/asm/x86_64-gf2m.pl
@@ -421,4 +421,4 @@ ___
$code =~ s/\`([^\`]*)\`/eval($1)/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/bn/asm/x86_64-mont.pl b/crypto/bn/asm/x86_64-mont.pl
index 01d6bbd64d..f793008225 100755
--- a/crypto/bn/asm/x86_64-mont.pl
+++ b/crypto/bn/asm/x86_64-mont.pl
@@ -1589,4 +1589,4 @@ ___
}
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/bn/asm/x86_64-mont5.pl b/crypto/bn/asm/x86_64-mont5.pl
index f5bd0fc6e5..36a30ee336 100755
--- a/crypto/bn/asm/x86_64-mont5.pl
+++ b/crypto/bn/asm/x86_64-mont5.pl
@@ -3960,4 +3960,4 @@ ___
$code =~ s/\`([^\`]*)\`/eval($1)/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/c64xpluscpuid.pl b/crypto/c64xpluscpuid.pl
index b7b11d5031..496ae3f05a 100644
--- a/crypto/c64xpluscpuid.pl
+++ b/crypto/c64xpluscpuid.pl
@@ -284,4 +284,4 @@ bus_loop2_done?:
___
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/camellia/asm/cmll-x86.pl b/crypto/camellia/asm/cmll-x86.pl
index 55af9b4e3d..6d6fe9bc8a 100644
--- a/crypto/camellia/asm/cmll-x86.pl
+++ b/crypto/camellia/asm/cmll-x86.pl
@@ -1147,4 +1147,4 @@ my ($s0,$s1,$s2,$s3) = @T;
&asm_finish();
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/camellia/asm/cmll-x86_64.pl b/crypto/camellia/asm/cmll-x86_64.pl
index ff7bf12f3b..36fd7cbfd4 100644
--- a/crypto/camellia/asm/cmll-x86_64.pl
+++ b/crypto/camellia/asm/cmll-x86_64.pl
@@ -1150,4 +1150,4 @@ ___
$code =~ s/\`([^\`]*)\`/eval $1/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/camellia/asm/cmllt4-sparcv9.pl b/crypto/camellia/asm/cmllt4-sparcv9.pl
index 6396679a5a..30c5f95df3 100644
--- a/crypto/camellia/asm/cmllt4-sparcv9.pl
+++ b/crypto/camellia/asm/cmllt4-sparcv9.pl
@@ -936,4 +936,4 @@ ___
&emit_assembler();
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/cast/asm/cast-586.pl b/crypto/cast/asm/cast-586.pl
index d5d38965cf..038f36e57d 100644
--- a/crypto/cast/asm/cast-586.pl
+++ b/crypto/cast/asm/cast-586.pl
@@ -46,7 +46,7 @@ $S4="CAST_S_table3";
&asm_finish();
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
sub CAST_encrypt {
local($name,$enc)=@_;
diff --git a/crypto/chacha/asm/chacha-armv4.pl b/crypto/chacha/asm/chacha-armv4.pl
index d3fadcc63d..736b1d0b0c 100755
--- a/crypto/chacha/asm/chacha-armv4.pl
+++ b/crypto/chacha/asm/chacha-armv4.pl
@@ -1157,4 +1157,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/chacha/asm/chacha-armv8.pl b/crypto/chacha/asm/chacha-armv8.pl
index e90be6d0e5..f8174055b3 100755
--- a/crypto/chacha/asm/chacha-armv8.pl
+++ b/crypto/chacha/asm/chacha-armv8.pl
@@ -1141,4 +1141,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT; # flush
+close STDOUT or die "error closing STDOUT: $!"; # flush
diff --git a/crypto/chacha/asm/chacha-c64xplus.pl b/crypto/chacha/asm/chacha-c64xplus.pl
index 266401eb16..6b37618d9a 100755
--- a/crypto/chacha/asm/chacha-c64xplus.pl
+++ b/crypto/chacha/asm/chacha-c64xplus.pl
@@ -923,4 +923,4 @@ $code.=<<___;
___
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/chacha/asm/chacha-ppc.pl b/crypto/chacha/asm/chacha-ppc.pl
index f4f8610bf3..04d00b5eaf 100755
--- a/crypto/chacha/asm/chacha-ppc.pl
+++ b/crypto/chacha/asm/chacha-ppc.pl
@@ -1345,4 +1345,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/chacha/asm/chacha-s390x.pl b/crypto/chacha/asm/chacha-s390x.pl
index c31526473d..f8deecf262 100755
--- a/crypto/chacha/asm/chacha-s390x.pl
+++ b/crypto/chacha/asm/chacha-s390x.pl
@@ -323,4 +323,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/chacha/asm/chacha-x86.pl b/crypto/chacha/asm/chacha-x86.pl
index b68d07fcb7..bdf53c877d 100755
--- a/crypto/chacha/asm/chacha-x86.pl
+++ b/crypto/chacha/asm/chacha-x86.pl
@@ -1152,4 +1152,4 @@ sub XOPROUND {
&asm_finish();
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/chacha/asm/chacha-x86_64.pl b/crypto/chacha/asm/chacha-x86_64.pl
index afb3fbf4a2..d80ab13776 100755
--- a/crypto/chacha/asm/chacha-x86_64.pl
+++ b/crypto/chacha/asm/chacha-x86_64.pl
@@ -4002,4 +4002,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/des/asm/crypt586.pl b/crypto/des/asm/crypt586.pl
index a02d180631..3bd6b8a7f8 100644
--- a/crypto/des/asm/crypt586.pl
+++ b/crypto/des/asm/crypt586.pl
@@ -25,7 +25,7 @@ $R="esi";
&fcrypt_body("fcrypt_body");
&asm_finish();
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
sub fcrypt_body
{
diff --git a/crypto/des/asm/des-586.pl b/crypto/des/asm/des-586.pl
index 2bcc54ef2f..49cf6bd173 100644
--- a/crypto/des/asm/des-586.pl
+++ b/crypto/des/asm/des-586.pl
@@ -47,7 +47,7 @@ $small_footprint=1 if (grep(/\-DOPENSSL_SMALL_FOOTPRINT/, at ARGV));
&asm_finish();
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
sub DES_encrypt_internal()
{
diff --git a/crypto/des/asm/dest4-sparcv9.pl b/crypto/des/asm/dest4-sparcv9.pl
index fe1fdc7025..a67af1def6 100644
--- a/crypto/des/asm/dest4-sparcv9.pl
+++ b/crypto/des/asm/dest4-sparcv9.pl
@@ -624,4 +624,4 @@ ___
&emit_assembler();
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/ec/asm/ecp_nistz256-armv4.pl b/crypto/ec/asm/ecp_nistz256-armv4.pl
index f5e7a88163..ce2269ae67 100755
--- a/crypto/ec/asm/ecp_nistz256-armv4.pl
+++ b/crypto/ec/asm/ecp_nistz256-armv4.pl
@@ -1849,4 +1849,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT; # enforce flush
+close STDOUT or die "error closing STDOUT: $!"; # enforce flush
diff --git a/crypto/ec/asm/ecp_nistz256-armv8.pl b/crypto/ec/asm/ecp_nistz256-armv8.pl
index e32d0d9344..66da3b6395 100644
--- a/crypto/ec/asm/ecp_nistz256-armv8.pl
+++ b/crypto/ec/asm/ecp_nistz256-armv8.pl
@@ -1871,4 +1871,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT; # enforce flush
+close STDOUT or die "error closing STDOUT: $!"; # enforce flush
diff --git a/crypto/ec/asm/ecp_nistz256-avx2.pl b/crypto/ec/asm/ecp_nistz256-avx2.pl
index a8cce34bbe..f0ff88ac0d 100755
--- a/crypto/ec/asm/ecp_nistz256-avx2.pl
+++ b/crypto/ec/asm/ecp_nistz256-avx2.pl
@@ -2077,4 +2077,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/ec/asm/ecp_nistz256-ppc64.pl b/crypto/ec/asm/ecp_nistz256-ppc64.pl
index 984c7f2050..bc21df6f44 100755
--- a/crypto/ec/asm/ecp_nistz256-ppc64.pl
+++ b/crypto/ec/asm/ecp_nistz256-ppc64.pl
@@ -2379,4 +2379,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT; # enforce flush
+close STDOUT or die "error closing STDOUT: $!"; # enforce flush
diff --git a/crypto/ec/asm/ecp_nistz256-sparcv9.pl b/crypto/ec/asm/ecp_nistz256-sparcv9.pl
index 4383bea4a7..f345623b9a 100755
--- a/crypto/ec/asm/ecp_nistz256-sparcv9.pl
+++ b/crypto/ec/asm/ecp_nistz256-sparcv9.pl
@@ -3057,4 +3057,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/ec/asm/ecp_nistz256-x86.pl b/crypto/ec/asm/ecp_nistz256-x86.pl
index 1a44c639d7..cc30e74f31 100755
--- a/crypto/ec/asm/ecp_nistz256-x86.pl
+++ b/crypto/ec/asm/ecp_nistz256-x86.pl
@@ -1859,4 +1859,4 @@ for ($i=0;$i<7;$i++) {
&asm_finish();
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/ec/asm/ecp_nistz256-x86_64.pl b/crypto/ec/asm/ecp_nistz256-x86_64.pl
index 94b08165d0..a678c6d66e 100755
--- a/crypto/ec/asm/ecp_nistz256-x86_64.pl
+++ b/crypto/ec/asm/ecp_nistz256-x86_64.pl
@@ -4736,4 +4736,4 @@ ___
$code =~ s/\`([^\`]*)\`/eval $1/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/ec/asm/x25519-ppc64.pl b/crypto/ec/asm/x25519-ppc64.pl
index 6e8b36420f..1f2f161f59 100755
--- a/crypto/ec/asm/x25519-ppc64.pl
+++ b/crypto/ec/asm/x25519-ppc64.pl
@@ -821,4 +821,4 @@ ___
$code =~ s/\`([^\`]*)\`/eval $1/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/ec/asm/x25519-x86_64.pl b/crypto/ec/asm/x25519-x86_64.pl
index 3a4a1483e7..8e625c1147 100755
--- a/crypto/ec/asm/x25519-x86_64.pl
+++ b/crypto/ec/asm/x25519-x86_64.pl
@@ -1128,4 +1128,4 @@ ___
$code =~ s/\`([^\`]*)\`/eval $1/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/md5/asm/md5-586.pl b/crypto/md5/asm/md5-586.pl
index 15e14864d1..fe82c2e062 100644
--- a/crypto/md5/asm/md5-586.pl
+++ b/crypto/md5/asm/md5-586.pl
@@ -43,7 +43,7 @@ $X="esi";
&md5_block("md5_block_asm_data_order");
&asm_finish();
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
sub Np
{
diff --git a/crypto/md5/asm/md5-sparcv9.pl b/crypto/md5/asm/md5-sparcv9.pl
index 6a62c62531..2f2c7b0f8e 100644
--- a/crypto/md5/asm/md5-sparcv9.pl
+++ b/crypto/md5/asm/md5-sparcv9.pl
@@ -434,4 +434,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/md5/asm/md5-x86_64.pl b/crypto/md5/asm/md5-x86_64.pl
index 386d8048ec..10b5f2de74 100755
--- a/crypto/md5/asm/md5-x86_64.pl
+++ b/crypto/md5/asm/md5-x86_64.pl
@@ -390,4 +390,4 @@ ___
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/modes/asm/aesni-gcm-x86_64.pl b/crypto/modes/asm/aesni-gcm-x86_64.pl
index 80e61faacf..a11036c464 100644
--- a/crypto/modes/asm/aesni-gcm-x86_64.pl
+++ b/crypto/modes/asm/aesni-gcm-x86_64.pl
@@ -1104,4 +1104,4 @@ $code =~ s/\`([^\`]*)\`/eval($1)/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/modes/asm/ghash-alpha.pl b/crypto/modes/asm/ghash-alpha.pl
index ccf6b2bd6f..654b9c8272 100644
--- a/crypto/modes/asm/ghash-alpha.pl
+++ b/crypto/modes/asm/ghash-alpha.pl
@@ -463,5 +463,5 @@ rem_4bit:
___
$output=pop and open STDOUT,">$output";
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/modes/asm/ghash-armv4.pl b/crypto/modes/asm/ghash-armv4.pl
index dcc23f7d7d..d07a249b1e 100644
--- a/crypto/modes/asm/ghash-armv4.pl
+++ b/crypto/modes/asm/ghash-armv4.pl
@@ -548,4 +548,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT; # enforce flush
+close STDOUT or die "error closing STDOUT: $!"; # enforce flush
diff --git a/crypto/modes/asm/ghash-c64xplus.pl b/crypto/modes/asm/ghash-c64xplus.pl
index 3cadda3994..c60f5915e0 100644
--- a/crypto/modes/asm/ghash-c64xplus.pl
+++ b/crypto/modes/asm/ghash-c64xplus.pl
@@ -244,4 +244,4 @@ $code.=<<___;
___
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/modes/asm/ghash-ia64.pl b/crypto/modes/asm/ghash-ia64.pl
index eb9ded91e5..2586a4e22d 100755
--- a/crypto/modes/asm/ghash-ia64.pl
+++ b/crypto/modes/asm/ghash-ia64.pl
@@ -467,4 +467,4 @@ $code =~ s/mux1(\s+)\S+\@rev/nop.i$1 0x0/gm if ($big_endian);
$code =~ s/\`([^\`]*)\`/eval $1/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/modes/asm/ghash-parisc.pl b/crypto/modes/asm/ghash-parisc.pl
index a614c99c22..0ed7e3fa8f 100644
--- a/crypto/modes/asm/ghash-parisc.pl
+++ b/crypto/modes/asm/ghash-parisc.pl
@@ -745,4 +745,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/modes/asm/ghash-s390x.pl b/crypto/modes/asm/ghash-s390x.pl
index 17dc375053..fc0181f6c8 100644
--- a/crypto/modes/asm/ghash-s390x.pl
+++ b/crypto/modes/asm/ghash-s390x.pl
@@ -259,4 +259,4 @@ ___
$code =~ s/\`([^\`]*)\`/eval $1/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/modes/asm/ghash-sparcv9.pl b/crypto/modes/asm/ghash-sparcv9.pl
index c4eb3b1f02..2d835c4103 100644
--- a/crypto/modes/asm/ghash-sparcv9.pl
+++ b/crypto/modes/asm/ghash-sparcv9.pl
@@ -578,4 +578,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/modes/asm/ghash-x86.pl b/crypto/modes/asm/ghash-x86.pl
index bcbe6e399d..8bde220ae5 100644
--- a/crypto/modes/asm/ghash-x86.pl
+++ b/crypto/modes/asm/ghash-x86.pl
@@ -1378,7 +1378,7 @@ my ($Xhi,$Xi)=@_;
&asciz("GHASH for x86, CRYPTOGAMS by <appro\@openssl.org>");
&asm_finish();
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
# A question was risen about choice of vanilla MMX. Or rather why wasn't
# SSE2 chosen instead? In addition to the fact that MMX runs on legacy
diff --git a/crypto/modes/asm/ghash-x86_64.pl b/crypto/modes/asm/ghash-x86_64.pl
index 1e5221005d..554c5f5452 100644
--- a/crypto/modes/asm/ghash-x86_64.pl
+++ b/crypto/modes/asm/ghash-x86_64.pl
@@ -1815,4 +1815,4 @@ $code =~ s/\`([^\`]*)\`/eval($1)/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/modes/asm/ghashp8-ppc.pl b/crypto/modes/asm/ghashp8-ppc.pl
index 6a2ac71295..682c846220 100755
--- a/crypto/modes/asm/ghashp8-ppc.pl
+++ b/crypto/modes/asm/ghashp8-ppc.pl
@@ -668,4 +668,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT; # enforce flush
+close STDOUT or die "error closing STDOUT: $!"; # enforce flush
diff --git a/crypto/modes/asm/ghashv8-armx.pl b/crypto/modes/asm/ghashv8-armx.pl
index 47e8820080..bfcd67df35 100644
--- a/crypto/modes/asm/ghashv8-armx.pl
+++ b/crypto/modes/asm/ghashv8-armx.pl
@@ -778,4 +778,4 @@ if ($flavour =~ /64/) { ######## 64-bit code
}
}
-close STDOUT; # enforce flush
+close STDOUT or die "error closing STDOUT: $!"; # enforce flush
diff --git a/crypto/pariscid.pl b/crypto/pariscid.pl
index 5a231c49f0..d039bf4a87 100644
--- a/crypto/pariscid.pl
+++ b/crypto/pariscid.pl
@@ -272,5 +272,5 @@ foreach(split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/perlasm/arm-xlate.pl b/crypto/perlasm/arm-xlate.pl
index ca2f8b990b..90ec5ce7ef 100755
--- a/crypto/perlasm/arm-xlate.pl
+++ b/crypto/perlasm/arm-xlate.pl
@@ -174,4 +174,4 @@ while(my $line=<>) {
print "\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/perlasm/ppc-xlate.pl b/crypto/perlasm/ppc-xlate.pl
index d220c6245b..3bb8f23299 100755
--- a/crypto/perlasm/ppc-xlate.pl
+++ b/crypto/perlasm/ppc-xlate.pl
@@ -341,4 +341,4 @@ while($line=<>) {
print "\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/perlasm/x86_64-xlate.pl b/crypto/perlasm/x86_64-xlate.pl
index 29a0eacfd5..ff57e507d7 100755
--- a/crypto/perlasm/x86_64-xlate.pl
+++ b/crypto/perlasm/x86_64-xlate.pl
@@ -1216,7 +1216,7 @@ while(defined(my $line=<>)) {
print "\n$current_segment\tENDS\n" if ($current_segment && $masm);
print "END\n" if ($masm);
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
#################################################
# Cross-reference x86_64 ABI "card"
diff --git a/crypto/poly1305/asm/poly1305-armv4.pl b/crypto/poly1305/asm/poly1305-armv4.pl
index 5cdb6be059..659d77dff0 100755
--- a/crypto/poly1305/asm/poly1305-armv4.pl
+++ b/crypto/poly1305/asm/poly1305-armv4.pl
@@ -1250,4 +1250,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT; # enforce flush
+close STDOUT or die "error closing STDOUT: $!"; # enforce flush
diff --git a/crypto/poly1305/asm/poly1305-armv8.pl b/crypto/poly1305/asm/poly1305-armv8.pl
index 6c6c9bb05b..0a3c34cc7d 100755
--- a/crypto/poly1305/asm/poly1305-armv8.pl
+++ b/crypto/poly1305/asm/poly1305-armv8.pl
@@ -943,4 +943,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/poly1305/asm/poly1305-mips.pl b/crypto/poly1305/asm/poly1305-mips.pl
index 28b6772ee5..73a710a16f 100755
--- a/crypto/poly1305/asm/poly1305-mips.pl
+++ b/crypto/poly1305/asm/poly1305-mips.pl
@@ -433,5 +433,5 @@ ___
$output=pop and open STDOUT,">$output";
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/poly1305/asm/poly1305-ppc.pl b/crypto/poly1305/asm/poly1305-ppc.pl
index 0c6d015d58..c077e0c307 100755
--- a/crypto/poly1305/asm/poly1305-ppc.pl
+++ b/crypto/poly1305/asm/poly1305-ppc.pl
@@ -642,4 +642,4 @@ ___
$code =~ s/\`([^\`]*)\`/eval $1/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/poly1305/asm/poly1305-ppcfp.pl b/crypto/poly1305/asm/poly1305-ppcfp.pl
index 09f8185848..9dc352171a 100755
--- a/crypto/poly1305/asm/poly1305-ppcfp.pl
+++ b/crypto/poly1305/asm/poly1305-ppcfp.pl
@@ -736,4 +736,4 @@ ___
$code =~ s/\`([^\`]*)\`/eval $1/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/poly1305/asm/poly1305-s390x.pl b/crypto/poly1305/asm/poly1305-s390x.pl
index 82d757d9a1..31a58fdb69 100755
--- a/crypto/poly1305/asm/poly1305-s390x.pl
+++ b/crypto/poly1305/asm/poly1305-s390x.pl
@@ -224,4 +224,4 @@ $code =~ s/\`([^\`]*)\`/eval $1/gem;
$code =~ s/\b(srlg\s+)(%r[0-9]+\s*,)\s*([0-9]+)/$1$2$2$3/gm;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/poly1305/asm/poly1305-sparcv9.pl b/crypto/poly1305/asm/poly1305-sparcv9.pl
index 0bdd048925..db96af645f 100755
--- a/crypto/poly1305/asm/poly1305-sparcv9.pl
+++ b/crypto/poly1305/asm/poly1305-sparcv9.pl
@@ -1117,4 +1117,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/poly1305/asm/poly1305-x86.pl b/crypto/poly1305/asm/poly1305-x86.pl
index 3e0e7883be..a02823361b 100755
--- a/crypto/poly1305/asm/poly1305-x86.pl
+++ b/crypto/poly1305/asm/poly1305-x86.pl
@@ -1812,4 +1812,4 @@ sub vlazy_reduction {
&asm_finish();
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/poly1305/asm/poly1305-x86_64.pl b/crypto/poly1305/asm/poly1305-x86_64.pl
index c3b7ce3658..4aa71783ee 100755
--- a/crypto/poly1305/asm/poly1305-x86_64.pl
+++ b/crypto/poly1305/asm/poly1305-x86_64.pl
@@ -4180,4 +4180,4 @@ foreach (split('\n',$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/ppccpuid.pl b/crypto/ppccpuid.pl
index a38445fd3c..4e35978d84 100755
--- a/crypto/ppccpuid.pl
+++ b/crypto/ppccpuid.pl
@@ -379,4 +379,4 @@ ___
$code =~ s/\`([^\`]*)\`/eval $1/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/rc4/asm/rc4-586.pl b/crypto/rc4/asm/rc4-586.pl
index 8c5cf87d05..211f0cd90e 100644
--- a/crypto/rc4/asm/rc4-586.pl
+++ b/crypto/rc4/asm/rc4-586.pl
@@ -423,4 +423,4 @@ $idx="edx";
&asm_finish();
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/rc4/asm/rc4-c64xplus.pl b/crypto/rc4/asm/rc4-c64xplus.pl
index 1354d18214..c2843aea06 100644
--- a/crypto/rc4/asm/rc4-c64xplus.pl
+++ b/crypto/rc4/asm/rc4-c64xplus.pl
@@ -189,4 +189,4 @@ ___
$output=pop;
open STDOUT,">$output";
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/rc4/asm/rc4-md5-x86_64.pl b/crypto/rc4/asm/rc4-md5-x86_64.pl
index 7b02f09fed..0679c590d5 100644
--- a/crypto/rc4/asm/rc4-md5-x86_64.pl
+++ b/crypto/rc4/asm/rc4-md5-x86_64.pl
@@ -660,4 +660,4 @@ $code =~ s/#rc4#//gm if ($rc4);
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/rc4/asm/rc4-parisc.pl b/crypto/rc4/asm/rc4-parisc.pl
index 4111f339da..947dd4903b 100644
--- a/crypto/rc4/asm/rc4-parisc.pl
+++ b/crypto/rc4/asm/rc4-parisc.pl
@@ -330,4 +330,4 @@ foreach(split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/rc4/asm/rc4-s390x.pl b/crypto/rc4/asm/rc4-s390x.pl
index 984afaab5c..b528d3feec 100644
--- a/crypto/rc4/asm/rc4-s390x.pl
+++ b/crypto/rc4/asm/rc4-s390x.pl
@@ -238,4 +238,4 @@ RC4_options:
___
print $code;
-close STDOUT; # force flush
+close STDOUT or die "error closing STDOUT: $!"; # force flush
diff --git a/crypto/rc4/asm/rc4-x86_64.pl b/crypto/rc4/asm/rc4-x86_64.pl
index 32d842c59f..7af3df46d0 100755
--- a/crypto/rc4/asm/rc4-x86_64.pl
+++ b/crypto/rc4/asm/rc4-x86_64.pl
@@ -698,4 +698,4 @@ $code =~ s/\`([^\`]*)\`/eval $1/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/rc5/asm/rc5-586.pl b/crypto/rc5/asm/rc5-586.pl
index e58a98bc83..b7d7ae6aee 100644
--- a/crypto/rc5/asm/rc5-586.pl
+++ b/crypto/rc5/asm/rc5-586.pl
@@ -32,7 +32,7 @@ $tmp4="edx";
&cbc("RC5_32_cbc_encrypt","RC5_32_encrypt","RC5_32_decrypt",0,4,5,3,-1,-1);
&asm_finish();
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
sub RC5_32_encrypt
{
diff --git a/crypto/ripemd/asm/rmd-586.pl b/crypto/ripemd/asm/rmd-586.pl
index 84aa7ced17..b34f7bb2e4 100644
--- a/crypto/ripemd/asm/rmd-586.pl
+++ b/crypto/ripemd/asm/rmd-586.pl
@@ -70,7 +70,7 @@ $KR3=0x7A6D76E9;
&ripemd160_block("ripemd160_block_asm_data_order");
&asm_finish();
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
sub Xv
{
diff --git a/crypto/s390xcpuid.pl b/crypto/s390xcpuid.pl
index ec700a47d9..a584ca4bc5 100755
--- a/crypto/s390xcpuid.pl
+++ b/crypto/s390xcpuid.pl
@@ -418,4 +418,4 @@ ___
$code =~ s/\`([^\`]*)\`/eval $1/gem;
print $code;
-close STDOUT; # force flush
+close STDOUT or die "error closing STDOUT: $!"; # force flush
diff --git a/crypto/sha/asm/keccak1600-armv4.pl b/crypto/sha/asm/keccak1600-armv4.pl
index cb8ccc90f5..a58c3ffb5c 100755
--- a/crypto/sha/asm/keccak1600-armv4.pl
+++ b/crypto/sha/asm/keccak1600-armv4.pl
@@ -1603,4 +1603,4 @@ foreach (split($/,$code)) {
print $_,"\n";
}
-close STDOUT; # enforce flush
+close STDOUT or die "error closing STDOUT: $!"; # enforce flush
diff --git a/crypto/sha/asm/keccak1600-armv8.pl b/crypto/sha/asm/keccak1600-armv8.pl
index 3173c77f53..9bd6776d1f 100755
--- a/crypto/sha/asm/keccak1600-armv8.pl
+++ b/crypto/sha/asm/keccak1600-armv8.pl
@@ -877,4 +877,4 @@ foreach(split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/sha/asm/keccak1600-avx2.pl b/crypto/sha/asm/keccak1600-avx2.pl
index d9fc1c59ec..ce4f5a4b78 100755
--- a/crypto/sha/asm/keccak1600-avx2.pl
+++ b/crypto/sha/asm/keccak1600-avx2.pl
@@ -479,4 +479,4 @@ ___
$output=pop;
open STDOUT,">$output";
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/sha/asm/keccak1600-avx512.pl b/crypto/sha/asm/keccak1600-avx512.pl
index 9074ff02de..41fd2fb446 100755
--- a/crypto/sha/asm/keccak1600-avx512.pl
+++ b/crypto/sha/asm/keccak1600-avx512.pl
@@ -548,4 +548,4 @@ ___
$output=pop;
open STDOUT,">$output";
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/sha/asm/keccak1600-avx512vl.pl b/crypto/sha/asm/keccak1600-avx512vl.pl
index a21bb8615a..ee630d685d 100755
--- a/crypto/sha/asm/keccak1600-avx512vl.pl
+++ b/crypto/sha/asm/keccak1600-avx512vl.pl
@@ -389,4 +389,4 @@ ___
$output=pop;
open STDOUT,">$output";
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/sha/asm/keccak1600-c64x.pl b/crypto/sha/asm/keccak1600-c64x.pl
index b00af9af91..1e49b508d6 100755
--- a/crypto/sha/asm/keccak1600-c64x.pl
+++ b/crypto/sha/asm/keccak1600-c64x.pl
@@ -882,4 +882,4 @@ ___
$output=pop;
open STDOUT,">$output";
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/sha/asm/keccak1600-mmx.pl b/crypto/sha/asm/keccak1600-mmx.pl
index be24394d35..b390309b80 100755
--- a/crypto/sha/asm/keccak1600-mmx.pl
+++ b/crypto/sha/asm/keccak1600-mmx.pl
@@ -437,4 +437,4 @@ sub Rho() { ######### regular Rho step
&asm_finish();
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/sha/asm/keccak1600-ppc64.pl b/crypto/sha/asm/keccak1600-ppc64.pl
index 30e70c5d6d..c46c8530ee 100755
--- a/crypto/sha/asm/keccak1600-ppc64.pl
+++ b/crypto/sha/asm/keccak1600-ppc64.pl
@@ -755,4 +755,4 @@ ___
$code =~ s/\`([^\`]*)\`/eval $1/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/sha/asm/keccak1600-s390x.pl b/crypto/sha/asm/keccak1600-s390x.pl
index 1184cf233e..188231e2b1 100755
--- a/crypto/sha/asm/keccak1600-s390x.pl
+++ b/crypto/sha/asm/keccak1600-s390x.pl
@@ -557,4 +557,4 @@ ___
$code =~ s/(srlg\s+)(%r[0-9]+),/$1$2,$2,/gm;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/sha/asm/keccak1600-x86_64.pl b/crypto/sha/asm/keccak1600-x86_64.pl
index 34457034bf..a48d40dbf5 100755
--- a/crypto/sha/asm/keccak1600-x86_64.pl
+++ b/crypto/sha/asm/keccak1600-x86_64.pl
@@ -606,4 +606,4 @@ foreach (split("\n",$code)) {
print $_, "\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/sha/asm/keccak1600p8-ppc.pl b/crypto/sha/asm/keccak1600p8-ppc.pl
index de2bcd660a..0dfb962096 100755
--- a/crypto/sha/asm/keccak1600p8-ppc.pl
+++ b/crypto/sha/asm/keccak1600p8-ppc.pl
@@ -847,4 +847,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/sha/asm/sha1-586.pl b/crypto/sha/asm/sha1-586.pl
index 38167b9c5c..c0679a31ce 100644
--- a/crypto/sha/asm/sha1-586.pl
+++ b/crypto/sha/asm/sha1-586.pl
@@ -1488,4 +1488,4 @@ sub Xtail_avx()
&asm_finish();
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/sha/asm/sha1-alpha.pl b/crypto/sha/asm/sha1-alpha.pl
index c1a0b0c690..241853b347 100644
--- a/crypto/sha/asm/sha1-alpha.pl
+++ b/crypto/sha/asm/sha1-alpha.pl
@@ -326,4 +326,4 @@ $code.=<<___;
___
$output=pop and open STDOUT,">$output";
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/sha/asm/sha1-armv4-large.pl b/crypto/sha/asm/sha1-armv4-large.pl
index 7ff5bfbba6..61c832808d 100644
--- a/crypto/sha/asm/sha1-armv4-large.pl
+++ b/crypto/sha/asm/sha1-armv4-large.pl
@@ -739,4 +739,4 @@ foreach (split($/,$code)) {
print $_,$/;
}
-close STDOUT; # enforce flush
+close STDOUT or die "error closing STDOUT: $!"; # enforce flush
diff --git a/crypto/sha/asm/sha1-armv8.pl b/crypto/sha/asm/sha1-armv8.pl
index 3ba871fede..008f6959d4 100644
--- a/crypto/sha/asm/sha1-armv8.pl
+++ b/crypto/sha/asm/sha1-armv8.pl
@@ -361,4 +361,4 @@ foreach(split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/sha/asm/sha1-c64xplus.pl b/crypto/sha/asm/sha1-c64xplus.pl
index 4db2bcb06b..a47b663b47 100644
--- a/crypto/sha/asm/sha1-c64xplus.pl
+++ b/crypto/sha/asm/sha1-c64xplus.pl
@@ -334,4 +334,4 @@ $code.=<<___;
___
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/sha/asm/sha1-mb-x86_64.pl b/crypto/sha/asm/sha1-mb-x86_64.pl
index 9ac233abc9..6edadeed74 100644
--- a/crypto/sha/asm/sha1-mb-x86_64.pl
+++ b/crypto/sha/asm/sha1-mb-x86_64.pl
@@ -1625,4 +1625,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/sha/asm/sha1-mips.pl b/crypto/sha/asm/sha1-mips.pl
index 08f84bc3b3..de0a4ee7f2 100644
--- a/crypto/sha/asm/sha1-mips.pl
+++ b/crypto/sha/asm/sha1-mips.pl
@@ -458,4 +458,4 @@ $code.=<<___;
.asciiz "SHA1 for MIPS, CRYPTOGAMS by <appro\@openssl.org>"
___
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/sha/asm/sha1-parisc.pl b/crypto/sha/asm/sha1-parisc.pl
index b001be16a2..e5260d5ef8 100644
--- a/crypto/sha/asm/sha1-parisc.pl
+++ b/crypto/sha/asm/sha1-parisc.pl
@@ -276,4 +276,4 @@ foreach(split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/sha/asm/sha1-ppc.pl b/crypto/sha/asm/sha1-ppc.pl
index 0cda0a3e15..1518a5e560 100755
--- a/crypto/sha/asm/sha1-ppc.pl
+++ b/crypto/sha/asm/sha1-ppc.pl
@@ -348,4 +348,4 @@ ___
$code =~ s/\`([^\`]*)\`/eval $1/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/sha/asm/sha1-s390x.pl b/crypto/sha/asm/sha1-s390x.pl
index 5729c30898..92de811a02 100644
--- a/crypto/sha/asm/sha1-s390x.pl
+++ b/crypto/sha/asm/sha1-s390x.pl
@@ -246,4 +246,4 @@ ___
$code =~ s/\`([^\`]*)\`/eval $1/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/sha/asm/sha1-sparcv9.pl b/crypto/sha/asm/sha1-sparcv9.pl
index 3e612e3d5f..311cfa8adc 100644
--- a/crypto/sha/asm/sha1-sparcv9.pl
+++ b/crypto/sha/asm/sha1-sparcv9.pl
@@ -431,4 +431,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/sha/asm/sha1-sparcv9a.pl b/crypto/sha/asm/sha1-sparcv9a.pl
index 50d3e136a1..2ad651f68e 100644
--- a/crypto/sha/asm/sha1-sparcv9a.pl
+++ b/crypto/sha/asm/sha1-sparcv9a.pl
@@ -605,4 +605,4 @@ $code =~ s/\b(alignaddr)\s+(%[goli][0-7]),(%[goli][0-7]),(%[goli][0-7])/
&unalignaddr($1,$2,$3,$4)
/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/sha/asm/sha1-thumb.pl b/crypto/sha/asm/sha1-thumb.pl
index ac74a25d6e..b87248e1c7 100644
--- a/crypto/sha/asm/sha1-thumb.pl
+++ b/crypto/sha/asm/sha1-thumb.pl
@@ -263,4 +263,4 @@ $code.=<<___;
___
print $code;
-close STDOUT; # enforce flush
+close STDOUT or die "error closing STDOUT: $!"; # enforce flush
diff --git a/crypto/sha/asm/sha1-x86_64.pl b/crypto/sha/asm/sha1-x86_64.pl
index ef080f235a..e700133349 100755
--- a/crypto/sha/asm/sha1-x86_64.pl
+++ b/crypto/sha/asm/sha1-x86_64.pl
@@ -2129,4 +2129,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/sha/asm/sha256-586.pl b/crypto/sha/asm/sha256-586.pl
index 913fca3105..645d21cc74 100644
--- a/crypto/sha/asm/sha256-586.pl
+++ b/crypto/sha/asm/sha256-586.pl
@@ -1293,4 +1293,4 @@ sub bodyx_00_15 () { # +10%
&asm_finish();
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/sha/asm/sha256-armv4.pl b/crypto/sha/asm/sha256-armv4.pl
index edcfc31278..c2e46be79f 100644
--- a/crypto/sha/asm/sha256-armv4.pl
+++ b/crypto/sha/asm/sha256-armv4.pl
@@ -729,4 +729,4 @@ foreach (split($/,$code)) {
print $_,"\n";
}
-close STDOUT; # enforce flush
+close STDOUT or die "error closing STDOUT: $!"; # enforce flush
diff --git a/crypto/sha/asm/sha256-c64xplus.pl b/crypto/sha/asm/sha256-c64xplus.pl
index 3ab7d9b689..1ed1313149 100644
--- a/crypto/sha/asm/sha256-c64xplus.pl
+++ b/crypto/sha/asm/sha256-c64xplus.pl
@@ -317,4 +317,4 @@ K256:
___
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/sha/asm/sha256-mb-x86_64.pl b/crypto/sha/asm/sha256-mb-x86_64.pl
index 7556b2123b..e122356017 100644
--- a/crypto/sha/asm/sha256-mb-x86_64.pl
+++ b/crypto/sha/asm/sha256-mb-x86_64.pl
@@ -1611,4 +1611,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/sha/asm/sha512-586.pl b/crypto/sha/asm/sha512-586.pl
index 867ce30b97..4fca59ec0a 100644
--- a/crypto/sha/asm/sha512-586.pl
+++ b/crypto/sha/asm/sha512-586.pl
@@ -922,4 +922,4 @@ sub BODY_00_15_ssse3 { # "phase-less" copy of BODY_00_15_sse2
&asm_finish();
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/sha/asm/sha512-armv4.pl b/crypto/sha/asm/sha512-armv4.pl
index 0b4c5674d9..d880d2c422 100644
--- a/crypto/sha/asm/sha512-armv4.pl
+++ b/crypto/sha/asm/sha512-armv4.pl
@@ -665,4 +665,4 @@ while(<SELF>) {
close SELF;
print $code;
-close STDOUT; # enforce flush
+close STDOUT or die "error closing STDOUT: $!"; # enforce flush
diff --git a/crypto/sha/asm/sha512-armv8.pl b/crypto/sha/asm/sha512-armv8.pl
index 01ffe9f98c..ea0ed5877e 100644
--- a/crypto/sha/asm/sha512-armv8.pl
+++ b/crypto/sha/asm/sha512-armv8.pl
@@ -902,4 +902,4 @@ foreach(split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/sha/asm/sha512-c64xplus.pl b/crypto/sha/asm/sha512-c64xplus.pl
index 9ebfc92e23..b5b9e7cf97 100644
--- a/crypto/sha/asm/sha512-c64xplus.pl
+++ b/crypto/sha/asm/sha512-c64xplus.pl
@@ -435,4 +435,4 @@ K512:
___
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/sha/asm/sha512-mips.pl b/crypto/sha/asm/sha512-mips.pl
index dab684dde5..ffcf4d3bc1 100644
--- a/crypto/sha/asm/sha512-mips.pl
+++ b/crypto/sha/asm/sha512-mips.pl
@@ -518,4 +518,4 @@ ___
$code =~ s/\`([^\`]*)\`/eval $1/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/sha/asm/sha512-parisc.pl b/crypto/sha/asm/sha512-parisc.pl
index 59eb320ab6..9423fe1093 100755
--- a/crypto/sha/asm/sha512-parisc.pl
+++ b/crypto/sha/asm/sha512-parisc.pl
@@ -804,4 +804,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/sha/asm/sha512-ppc.pl b/crypto/sha/asm/sha512-ppc.pl
index 71699f6637..0f909c80a6 100755
--- a/crypto/sha/asm/sha512-ppc.pl
+++ b/crypto/sha/asm/sha512-ppc.pl
@@ -796,4 +796,4 @@ ___
$code =~ s/\`([^\`]*)\`/eval $1/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/sha/asm/sha512-s390x.pl b/crypto/sha/asm/sha512-s390x.pl
index 4c0f4e7931..6ca62f2b05 100644
--- a/crypto/sha/asm/sha512-s390x.pl
+++ b/crypto/sha/asm/sha512-s390x.pl
@@ -321,4 +321,4 @@ $code =~ s/\`([^\`]*)\`/eval $1/gem;
$code =~ s/(srlg\s+)(%r[0-9]+),/$1$2,$2,/gm;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/sha/asm/sha512-sparcv9.pl b/crypto/sha/asm/sha512-sparcv9.pl
index c215909633..8824a7889d 100644
--- a/crypto/sha/asm/sha512-sparcv9.pl
+++ b/crypto/sha/asm/sha512-sparcv9.pl
@@ -854,4 +854,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/sha/asm/sha512-x86_64.pl b/crypto/sha/asm/sha512-x86_64.pl
index 6259dc2469..d2b5f751fa 100755
--- a/crypto/sha/asm/sha512-x86_64.pl
+++ b/crypto/sha/asm/sha512-x86_64.pl
@@ -2555,4 +2555,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/sha/asm/sha512p8-ppc.pl b/crypto/sha/asm/sha512p8-ppc.pl
index 0d4fdd292c..cd162ed920 100755
--- a/crypto/sha/asm/sha512p8-ppc.pl
+++ b/crypto/sha/asm/sha512p8-ppc.pl
@@ -417,4 +417,4 @@ ___
$code =~ s/\`([^\`]*)\`/eval $1/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/whrlpool/asm/wp-mmx.pl b/crypto/whrlpool/asm/wp-mmx.pl
index f5a1ac0273..5ce02edde1 100644
--- a/crypto/whrlpool/asm/wp-mmx.pl
+++ b/crypto/whrlpool/asm/wp-mmx.pl
@@ -504,4 +504,4 @@ for($i=0;$i<8;$i++) {
&function_end_B("whirlpool_block_mmx");
&asm_finish();
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/whrlpool/asm/wp-x86_64.pl b/crypto/whrlpool/asm/wp-x86_64.pl
index fe23d8cad0..b878daec7c 100644
--- a/crypto/whrlpool/asm/wp-x86_64.pl
+++ b/crypto/whrlpool/asm/wp-x86_64.pl
@@ -614,4 +614,4 @@ ___
$code =~ s/\`([^\`]*)\`/eval $1/gem;
print $code;
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/crypto/x86_64cpuid.pl b/crypto/x86_64cpuid.pl
index b9d8f73222..781b297282 100644
--- a/crypto/x86_64cpuid.pl
+++ b/crypto/x86_64cpuid.pl
@@ -508,4 +508,4 @@ ___
gen_random("rdrand");
gen_random("rdseed");
-close STDOUT; # flush
+close STDOUT or die "error closing STDOUT: $!"; # flush
diff --git a/crypto/x86cpuid.pl b/crypto/x86cpuid.pl
index d43dda4d93..4656e038f5 100644
--- a/crypto/x86cpuid.pl
+++ b/crypto/x86cpuid.pl
@@ -506,4 +506,4 @@ my $rdop = shift;
&asm_finish();
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
More information about the openssl-commits
mailing list