X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=reentr.c;h=881bd87b7a31805f55f3e1fab39471dc815bae82;hb=f8f79f57f467ffff4d31dc518ce3f6d2364090a0;hp=052af90336cc6c40783a10b5961d29e9fd8d0bad;hpb=0de8cad8cba777e31f98ef8b8ac579070f7c78a6;p=p5sagit%2Fp5-mst-13.2.git diff --git a/reentr.c b/reentr.c index 052af90..881bd87 100644 --- a/reentr.c +++ b/reentr.c @@ -1,7 +1,7 @@ /* * reentr.c * - * Copyright (c) 1997-2002, Larry Wall + * Copyright (C) 2002, 2003, by Larry Wall and others * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -146,10 +146,8 @@ Perl_reentrant_init(pTHX) { New(31338, PL_reentrant_buffer->_asctime_buffer, PL_reentrant_buffer->_asctime_size, char); #endif /* HAS_ASCTIME_R */ #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; +#if CRYPT_R_PROTO != REENTRANT_PROTO_B_CCD + PL_reentrant_buffer->_crypt_struct_buffer = 0; #endif #endif /* HAS_CRYPT_R */ #ifdef HAS_CTIME_R @@ -230,6 +228,9 @@ Perl_reentrant_free(pTHX) { Safefree(PL_reentrant_buffer->_asctime_buffer); #endif /* HAS_ASCTIME_R */ #ifdef HAS_CRYPT_R +#if CRYPT_R_PROTO != REENTRANT_PROTO_B_CCD + Safefree(PL_reentrant_buffer->_crypt_struct_buffer); +#endif #endif /* HAS_CRYPT_R */ #ifdef HAS_CTIME_R Safefree(PL_reentrant_buffer->_ctime_buffer); @@ -300,7 +301,7 @@ Perl_reentrant_retry(const char *f, ...) dTHX; void *retptr = NULL; #ifdef USE_REENTRANT_API -# if defined(USE_HOSTENT_BUFFER) || defined(USE_GRENT_BUFFER) || defined(USE_NETENT_BUFFER) || defined(USE_PWENT_BUFFER) || defined(USE_PROTOENT_BUFFER) || defined(USE_SRVENT_BUFFER) +# if defined(USE_HOSTENT_BUFFER) || defined(USE_GRENT_BUFFER) || defined(USE_NETENT_BUFFER) || defined(USE_PWENT_BUFFER) || defined(USE_PROTOENT_BUFFER) || defined(USE_SERVENT_BUFFER) void *p0; # endif # if defined(USE_SERVENT_BUFFER) @@ -368,7 +369,11 @@ Perl_reentrant_retry(const char *f, ...) p0 = va_arg(ap, void *); retptr = getgrnam(p0); break; case OP_GGRGID: +#if Gid_t_size < INTSIZE + gid = (Gid_t)va_arg(ap, int); +#else gid = va_arg(ap, Gid_t); +#endif retptr = getgrgid(gid); break; case OP_GGRENT: retptr = getgrent(); break; @@ -431,7 +436,11 @@ Perl_reentrant_retry(const char *f, ...) p0 = va_arg(ap, void *); retptr = getpwnam(p0); break; case OP_GPWUID: +#if Uid_t_size < INTSIZE + uid = (Uid_t)va_arg(ap, int); +#else uid = va_arg(ap, Uid_t); +#endif retptr = getpwuid(uid); break; case OP_GPWENT: retptr = getpwent(); break;