From 21632774c37bb8874de17fa6ad931c73d19518cd Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Tue, 28 Mar 2006 18:50:00 +0000 Subject: perl 5.8.8 import --- gnu/usr.bin/perl/reentr.c | 48 ++++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 23 deletions(-) (limited to 'gnu/usr.bin/perl/reentr.c') diff --git a/gnu/usr.bin/perl/reentr.c b/gnu/usr.bin/perl/reentr.c index 7770e0b81f1..95d8521da67 100644 --- a/gnu/usr.bin/perl/reentr.c +++ b/gnu/usr.bin/perl/reentr.c @@ -1,7 +1,8 @@ -/* +/* -*- buffer-read-only: t -*- + * * reentr.c * - * Copyright (C) 2002, 2003, by Larry Wall and others + * Copyright (C) 2002, 2003, 2005 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 +147,10 @@ Perl_reentrant_size(pTHX) { void Perl_reentrant_init(pTHX) { #ifdef USE_REENTRANT_API - New(31337, PL_reentrant_buffer, 1, REENTR); + Newx(PL_reentrant_buffer, 1, REENTR); Perl_reentrant_size(aTHX); #ifdef HAS_ASCTIME_R - New(31338, PL_reentrant_buffer->_asctime_buffer, PL_reentrant_buffer->_asctime_size, char); + Newx(PL_reentrant_buffer->_asctime_buffer, PL_reentrant_buffer->_asctime_size, char); #endif /* HAS_ASCTIME_R */ #ifdef HAS_CRYPT_R #if CRYPT_R_PROTO != REENTRANT_PROTO_B_CCD @@ -157,7 +158,7 @@ Perl_reentrant_init(pTHX) { #endif #endif /* HAS_CRYPT_R */ #ifdef HAS_CTIME_R - New(31338, PL_reentrant_buffer->_ctime_buffer, PL_reentrant_buffer->_ctime_size, char); + Newx(PL_reentrant_buffer->_ctime_buffer, PL_reentrant_buffer->_ctime_size, char); #endif /* HAS_CTIME_R */ #ifdef HAS_DRAND48_R #endif /* HAS_DRAND48_R */ @@ -165,42 +166,42 @@ Perl_reentrant_init(pTHX) { # ifdef USE_GRENT_FPTR PL_reentrant_buffer->_grent_fptr = NULL; # endif - New(31338, PL_reentrant_buffer->_grent_buffer, PL_reentrant_buffer->_grent_size, char); + Newx(PL_reentrant_buffer->_grent_buffer, PL_reentrant_buffer->_grent_size, char); #endif /* HAS_GETGRNAM_R */ #ifdef HAS_GETHOSTBYNAME_R #if !(GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD) - New(31338, PL_reentrant_buffer->_hostent_buffer, PL_reentrant_buffer->_hostent_size, char); + Newx(PL_reentrant_buffer->_hostent_buffer, PL_reentrant_buffer->_hostent_size, char); #endif #endif /* HAS_GETHOSTBYNAME_R */ #ifdef HAS_GETLOGIN_R - New(31338, PL_reentrant_buffer->_getlogin_buffer, PL_reentrant_buffer->_getlogin_size, char); + Newx(PL_reentrant_buffer->_getlogin_buffer, PL_reentrant_buffer->_getlogin_size, char); #endif /* HAS_GETLOGIN_R */ #ifdef HAS_GETNETBYNAME_R #if !(GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD) - New(31338, PL_reentrant_buffer->_netent_buffer, PL_reentrant_buffer->_netent_size, char); + Newx(PL_reentrant_buffer->_netent_buffer, PL_reentrant_buffer->_netent_size, char); #endif #endif /* HAS_GETNETBYNAME_R */ #ifdef HAS_GETPROTOBYNAME_R #if !(GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD) - New(31338, PL_reentrant_buffer->_protoent_buffer, PL_reentrant_buffer->_protoent_size, char); + Newx(PL_reentrant_buffer->_protoent_buffer, PL_reentrant_buffer->_protoent_size, char); #endif #endif /* HAS_GETPROTOBYNAME_R */ #ifdef HAS_GETPWNAM_R # ifdef USE_PWENT_FPTR PL_reentrant_buffer->_pwent_fptr = NULL; # endif - New(31338, PL_reentrant_buffer->_pwent_buffer, PL_reentrant_buffer->_pwent_size, char); + Newx(PL_reentrant_buffer->_pwent_buffer, PL_reentrant_buffer->_pwent_size, char); #endif /* HAS_GETPWNAM_R */ #ifdef HAS_GETSERVBYNAME_R #if !(GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_I_CCSD) - New(31338, PL_reentrant_buffer->_servent_buffer, PL_reentrant_buffer->_servent_size, char); + Newx(PL_reentrant_buffer->_servent_buffer, PL_reentrant_buffer->_servent_size, char); #endif #endif /* HAS_GETSERVBYNAME_R */ #ifdef HAS_GETSPNAM_R # ifdef USE_SPENT_FPTR PL_reentrant_buffer->_spent_fptr = NULL; # endif - New(31338, PL_reentrant_buffer->_spent_buffer, PL_reentrant_buffer->_spent_size, char); + Newx(PL_reentrant_buffer->_spent_buffer, PL_reentrant_buffer->_spent_size, char); #endif /* HAS_GETSPNAM_R */ #ifdef HAS_GMTIME_R #endif /* HAS_GMTIME_R */ @@ -215,13 +216,13 @@ Perl_reentrant_init(pTHX) { PL_reentrant_buffer->_readdir64_struct = (struct dirent64*)safemalloc(PL_reentrant_buffer->_readdir64_size); #endif /* HAS_READDIR64_R */ #ifdef HAS_SETLOCALE_R - New(31338, PL_reentrant_buffer->_setlocale_buffer, PL_reentrant_buffer->_setlocale_size, char); + Newx(PL_reentrant_buffer->_setlocale_buffer, PL_reentrant_buffer->_setlocale_size, char); #endif /* HAS_SETLOCALE_R */ #ifdef HAS_STRERROR_R - New(31338, PL_reentrant_buffer->_strerror_buffer, PL_reentrant_buffer->_strerror_size, char); + Newx(PL_reentrant_buffer->_strerror_buffer, PL_reentrant_buffer->_strerror_size, char); #endif /* HAS_STRERROR_R */ #ifdef HAS_TTYNAME_R - New(31338, PL_reentrant_buffer->_ttyname_buffer, PL_reentrant_buffer->_ttyname_size, char); + Newx(PL_reentrant_buffer->_ttyname_buffer, PL_reentrant_buffer->_ttyname_size, char); #endif /* HAS_TTYNAME_R */ #endif /* USE_REENTRANT_API */ @@ -345,7 +346,7 @@ Perl_reentrant_retry(const char *f, ...) retptr = gethostbyaddr(p0, asize, anint); break; case OP_GHBYNAME: p0 = va_arg(ap, void *); - retptr = gethostbyname(p0); break; + retptr = gethostbyname((char *)p0); break; case OP_GHOSTENT: retptr = gethostent(); break; default: @@ -373,7 +374,7 @@ Perl_reentrant_retry(const char *f, ...) switch (PL_op->op_type) { case OP_GGRNAM: p0 = va_arg(ap, void *); - retptr = getgrnam(p0); break; + retptr = getgrnam((char *)p0); break; case OP_GGRGID: #if Gid_t_size < INTSIZE gid = (Gid_t)va_arg(ap, int); @@ -412,7 +413,7 @@ Perl_reentrant_retry(const char *f, ...) retptr = getnetbyaddr(net, anint); break; case OP_GNBYNAME: p0 = va_arg(ap, void *); - retptr = getnetbyname(p0); break; + retptr = getnetbyname((char *)p0); break; case OP_GNETENT: retptr = getnetent(); break; default: @@ -440,7 +441,7 @@ Perl_reentrant_retry(const char *f, ...) switch (PL_op->op_type) { case OP_GPWNAM: p0 = va_arg(ap, void *); - retptr = getpwnam(p0); break; + retptr = getpwnam((char *)p0); break; case OP_GPWUID: #if Uid_t_size < INTSIZE uid = (Uid_t)va_arg(ap, int); @@ -474,7 +475,7 @@ Perl_reentrant_retry(const char *f, ...) switch (PL_op->op_type) { case OP_GPBYNAME: p0 = va_arg(ap, void *); - retptr = getprotobyname(p0); break; + retptr = getprotobyname((char *)p0); break; case OP_GPBYNUMBER: anint = va_arg(ap, int); retptr = getprotobynumber(anint); break; @@ -505,11 +506,11 @@ Perl_reentrant_retry(const char *f, ...) case OP_GSBYNAME: p0 = va_arg(ap, void *); p1 = va_arg(ap, void *); - retptr = getservbyname(p0, p1); break; + retptr = getservbyname((char *)p0, (char *)p1); break; case OP_GSBYPORT: anint = va_arg(ap, int); p0 = va_arg(ap, void *); - retptr = getservbyport(anint, p0); break; + retptr = getservbyport(anint, (char *)p0); break; case OP_GSERVENT: retptr = getservent(); break; default: @@ -530,3 +531,4 @@ Perl_reentrant_retry(const char *f, ...) return retptr; } +/* ex: set ro: */ -- cgit v1.2.3