From: Jarkko Hietaniemi Date: Fri, 4 Oct 2002 16:11:57 +0000 (+0300) Subject: No warn, just ERANGE (Was: Re: [PATCH] reentrant buffers) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b5379b0df09a1d2f8fb44659104d41784790923d;p=p5sagit%2Fp5-mst-13.2.git No warn, just ERANGE (Was: Re: [PATCH] reentrant buffers) Message-ID: <20021004131157.GD278184@lyta.hut.fi> p4raw-id: //depot/perl@17999 --- diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 8f7d0ec..d0626bf 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -3135,14 +3135,6 @@ signed integers. See L. (F) You can't specify a repeat count so large that it overflows your signed integers. See L. -=item Result from %s larger than %d bytes - -(W misc) A library call like getgrent() tried to return more results -than Perl was willing to accept. This happens only when Perl has been -compiled to have threads and to have an upper limit on such calls -(the default is to keep regrowing the result buffer until the result fits). -However, now the results were truncated. - =item Reversed %s= operator (W syntax) You wrote your assignment operator backwards. The = must diff --git a/reentr.c b/reentr.c index 3d8cdf8..35a1e91 100644 --- a/reentr.c +++ b/reentr.c @@ -312,9 +312,6 @@ Perl_reentrant_retry(const char *f, ...) # if defined(USE_HOSTENT_BUFFER) || defined(USE_NETENT_BUFFER) || defined(USE_PROTOENT_BUFFER) || defined(USE_SERVENT_BUFFER) int anint; # endif -#ifdef PERL_REENTRANT_MAXSIZE - static const char larger[] = "Result from %s larger than %d bytes"; -#endif va_list ap; va_start(ap, f); @@ -348,6 +345,7 @@ Perl_reentrant_retry(const char *f, ...) break; } } + SETERRNO(ERANGE, LIB_INVARG); } break; #endif @@ -378,6 +376,7 @@ Perl_reentrant_retry(const char *f, ...) break; } } + SETERRNO(ERANGE, LIB_INVARG); } break; #endif @@ -409,11 +408,7 @@ Perl_reentrant_retry(const char *f, ...) break; } } -#ifdef PERL_REENTRANT_MAXSIZE - else if (ckWARN(WARN_MISC)) - Perl_warner(aTHX_ packWARN(WARN_MISC), - larger, OP_NAME(PL_op), PERL_REENTRANT_MAXSIZE); -#endif + SETERRNO(ERANGE, LIB_INVARG); } break; #endif @@ -444,11 +439,6 @@ Perl_reentrant_retry(const char *f, ...) break; } } -#ifdef PERL_REENTRANT_MAXSIZE - else if (ckWARN(WARN_MISC)) - Perl_warner(aTHX_ packWARN(WARN_MISC), - larger, OP_NAME(PL_op), PERL_REENTRANT_MAXSIZE); -#endif } break; #endif @@ -478,11 +468,7 @@ Perl_reentrant_retry(const char *f, ...) break; } } -#ifdef PERL_REENTRANT_MAXSIZE - else if (ckWARN(WARN_MISC)) - Perl_warner(aTHX_ packWARN(WARN_MISC), - larger, OP_NAME(PL_op), PERL_REENTRANT_MAXSIZE); -#endif + SETERRNO(ERANGE, LIB_INVARG); } break; #endif @@ -514,11 +500,7 @@ Perl_reentrant_retry(const char *f, ...) break; } } -#ifdef PERL_REENTRANT_MAXSIZE - else if (ckWARN(WARN_MISC)) - Perl_warner(aTHX_ packWARN(WARN_MISC), - larger, OP_NAME(PL_op), PERL_REENTRANT_MAXSIZE); -#endif + SETERRNO(ERANGE, LIB_INVARG); } break; #endif diff --git a/reentr.pl b/reentr.pl index 1f4e6ac..85ec64a 100644 --- a/reentr.pl +++ b/reentr.pl @@ -784,9 +784,6 @@ Perl_reentrant_retry(const char *f, ...) # if defined(USE_HOSTENT_BUFFER) || defined(USE_NETENT_BUFFER) || defined(USE_PROTOENT_BUFFER) || defined(USE_SERVENT_BUFFER) int anint; # endif -#ifdef PERL_REENTRANT_MAXSIZE - static const char larger[] = "Result from %s larger than %d bytes"; -#endif va_list ap; va_start(ap, f); @@ -881,11 +878,7 @@ Perl_reentrant_retry(const char *f, ...) break; } } -#ifdef PERL_REENTRANT_MAXSIZE - else if (ckWARN(WARN_MISC)) - Perl_warner(aTHX_ packWARN(WARN_MISC), - larger, OP_NAME(PL_op), PERL_REENTRANT_MAXSIZE); -#endif + SETERRNO(ERANGE, LIB_INVARG); } break; #endif @@ -916,11 +909,7 @@ Perl_reentrant_retry(const char *f, ...) break; } } -#ifdef PERL_REENTRANT_MAXSIZE - else if (ckWARN(WARN_MISC)) - Perl_warner(aTHX_ packWARN(WARN_MISC), - larger, OP_NAME(PL_op), PERL_REENTRANT_MAXSIZE); -#endif + SETERRNO(ERANGE, LIB_INVARG); } break; #endif @@ -950,11 +939,7 @@ Perl_reentrant_retry(const char *f, ...) break; } } -#ifdef PERL_REENTRANT_MAXSIZE - else if (ckWARN(WARN_MISC)) - Perl_warner(aTHX_ packWARN(WARN_MISC), - larger, OP_NAME(PL_op), PERL_REENTRANT_MAXSIZE); -#endif + SETERRNO(ERANGE, LIB_INVARG); } break; #endif @@ -986,11 +971,7 @@ Perl_reentrant_retry(const char *f, ...) break; } } -#ifdef PERL_REENTRANT_MAXSIZE - else if (ckWARN(WARN_MISC)) - Perl_warner(aTHX_ packWARN(WARN_MISC), - larger, OP_NAME(PL_op), PERL_REENTRANT_MAXSIZE); -#endif + SETERRNO(ERANGE, LIB_INVARG); } break; #endif