summaryrefslogtreecommitdiff
path: root/reentr.pl
diff options
context:
space:
mode:
Diffstat (limited to 'reentr.pl')
-rw-r--r--reentr.pl19
1 files changed, 12 insertions, 7 deletions
diff --git a/reentr.pl b/reentr.pl
index d96cb3ab06..4429bc4cb7 100644
--- a/reentr.pl
+++ b/reentr.pl
@@ -453,14 +453,17 @@ EOF
#if CRYPT_R_PROTO == REENTRANT_PROTO_B_CCD
$seend{$func} _${func}_data;
#else
- $seent{$func} _${func}_struct;
+ $seent{$func} *_${func}_struct_buffer;
#endif
EOF
push @init, <<EOF;
-#if defined(__GLIBC__) || defined(__EMX__)
- PL_reentrant_buffer->_${func}_struct.initialized = 0;
- /* work around glibc-2.2.5 bug */
- PL_reentrant_buffer->_${func}_struct.current_saltbits = 0;
+#if CRYPT_R_PROTO != REENTRANT_PROTO_B_CCD
+ PL_reentrant_buffer->_${func}_struct_buffer = 0;
+#endif
+EOF
+ push @free, <<EOF;
+#if CRYPT_R_PROTO != REENTRANT_PROTO_B_CCD
+ Safefree(PL_reentrant_buffer->_${func}_struct_buffer);
#endif
EOF
pushssif $endif;
@@ -661,9 +664,11 @@ EOF
$_ eq 'D' ?
"&PL_reentrant_buffer->_${genfunc}_data" :
$_ eq 'S' ?
- ($func =~ /^readdir/ ?
+ ($func =~ /^readdir\d*$/ ?
"PL_reentrant_buffer->_${genfunc}_struct" :
- "&PL_reentrant_buffer->_${genfunc}_struct" ) :
+ $func =~ /^crypt$/ ?
+ "PL_reentrant_buffer->_${genfunc}_struct_buffer" :
+ "&PL_reentrant_buffer->_${genfunc}_struct") :
$_ eq 'T' && $func eq 'drand48' ?
"&PL_reentrant_buffer->_${genfunc}_double" :
$_ =~ /^[ilt]$/ && $func eq 'random' ?