[perl #16729] crypt() doesn't work in multithreaded perl
mls@suse.de [Fri, 23 Aug 2002 15:24:39 +0000 (15:24 +0000)]
From: "mls@suse.de (via RT)" <perlbug@perl.org>
Message-Id: <rt-16729-35555.9.25145891475907@bugs6.perl.org>

p4raw-id: //depot/perl@17775

reentr.c

index 310848e..acbbac4 100644 (file)
--- a/reentr.c
+++ b/reentr.c
@@ -148,6 +148,8 @@ Perl_reentrant_init(pTHX) {
 #ifdef HAS_CRYPT_R
 #ifdef __GLIBC__
        PL_reentrant_buffer->_crypt_struct.initialized = 0;
+       /* work around glibc-2.2.5 bug */
+       PL_reentrant_buffer->_crypt_struct.current_saltbits = 0;
 #endif
 #endif /* HAS_CRYPT_R */
 #ifdef HAS_CTIME_R