From: Jarkko Hietaniemi Date: Thu, 5 Apr 2001 03:52:50 +0000 (+0000) Subject: Retract changes #9542 and #9538 (from maintperl, integrated X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8fbdfb7c7395370f456296bb6b83997100178b7a;p=p5sagit%2Fp5-mst-13.2.git Retract changes #9542 and #9538 (from maintperl, integrated at #9540), shouldn't be needed because of the perlio changes. p4raw-link: @9542 on //depot/perl: 771c8da8a7459d77e0377cf0a891bf62d70cdfa2 p4raw-id: //depot/perl@9552 --- diff --git a/util.c b/util.c index 0129285..c5a3af3 100644 --- a/util.c +++ b/util.c @@ -3958,52 +3958,39 @@ Perl_get_vtbl(pTHX_ int vtbl_id) return result; } -#ifdef PERLIO_IS_STDIO -# if !defined(FFLUSH_NULL) && defined(HAS__FWALK) -static int S_fflush(FILE *fp); - -static int -S_fflush(FILE *fp) -{ - return fflush(fp); /* fflush() maybe a macro but we need a function */ -} -# endif -#endif - I32 Perl_my_fflush_all(pTHX) { -#ifdef FFLUSH_NULL +#if defined(FFLUSH_NULL) return PerlIO_flush(NULL); #else -# ifdef PERLIO_IS_STDIO -# if defined(HAS__FWALK) +# if defined(HAS__FWALK) /* undocumented, unprototyped, but very useful BSDism */ extern void _fwalk(int (*)(FILE *)); - _fwalk(&S_fflush); + _fwalk(&fflush); return 0; -# else +# else long open_max = -1; -# if defined(FFLUSH_ALL) && defined(HAS_STDIO_STREAM_ARRAY) -# ifdef PERL_FFLUSH_ALL_FOPEN_MAX +# if defined(FFLUSH_ALL) && defined(HAS_STDIO_STREAM_ARRAY) +# ifdef PERL_FFLUSH_ALL_FOPEN_MAX open_max = PERL_FFLUSH_ALL_FOPEN_MAX; -# else -# if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX) +# else +# if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX) open_max = sysconf(_SC_OPEN_MAX); -# else -# ifdef FOPEN_MAX +# else +# ifdef FOPEN_MAX open_max = FOPEN_MAX; -# else -# ifdef OPEN_MAX +# else +# ifdef OPEN_MAX open_max = OPEN_MAX; -# else -# ifdef _NFILE +# else +# ifdef _NFILE open_max = _NFILE; -# endif -# endif # endif # endif # endif +# endif +# endif if (open_max > 0) { long i; for (i = 0; i < open_max; i++) @@ -4013,10 +4000,9 @@ Perl_my_fflush_all(pTHX) PerlIO_flush(&STDIO_STREAM_ARRAY[i]); return 0; } -# endif +# endif SETERRNO(EBADF,RMS$_IFI); return EOF; -# endif # endif #endif }