From: Nicholas Clark Date: Mon, 16 Oct 2000 18:28:23 +0000 (+0100) Subject: Workaround for a sfio bug where the stream error indicator X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2c534a3ff7453cba582a5200a69b07382e77425e;p=p5sagit%2Fp5-mst-13.2.git Workaround for a sfio bug where the stream error indicator is not cleared as documented. Subject: PATCH (was Re: [ID 20001016.007] Not OK: perl v5.7.0 +DEVEL7228 on i586-linux 2.2.16 (UNINSTALLED)) Message-ID: <20001016182823.J19700@plum.flirble.org> p4raw-id: //depot/perl@7353 --- diff --git a/doio.c b/doio.c index ea5ab29..2f78bc9 100644 --- a/doio.c +++ b/doio.c @@ -314,7 +314,13 @@ Perl_do_open9(pTHX_ GV *gv, register char *name, I32 len, int as_raw, * be optimized away on most platforms; * only Solaris and Linux seem to flush * on that. --jhi */ - PerlIO_seek(fp, 0, SEEK_CUR); +#ifdef USE_SFIO + /* sfio fails to clear error on next + sfwrite, contrary to documentation. + -- Nick Clark */ + if (PerlIO_seek(fp, 0, SEEK_CUR) == -1) + PerlIO_clearerr(fp); +#endif /* On the other hand, do all platforms * take gracefully to flushing a read-only * filehandle? Perhaps we should do