From: Gurusamy Sarathy Date: Mon, 26 Apr 1999 07:52:51 +0000 (+0000) Subject: integrate change#3229 from maint-5.004 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d175a3f045fc637f1a2ebcb20d3386cf109302c4;p=p5sagit%2Fp5-mst-13.2.git integrate change#3229 from maint-5.004 p4raw-link: @3229 on //depot/maint-5.004/perl: 3e0793ddbcfdff90910112e638ae702c43386bb6 p4raw-id: //depot/perl@3271 --- diff --git a/pp_ctl.c b/pp_ctl.c index e29ff19..7ac600b 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -1393,8 +1393,17 @@ die_where(char *message) } if (!message) message = SvPVx(ERRSV, n_a); - PerlIO_printf(PerlIO_stderr(), "%s",message); - PerlIO_flush(PerlIO_stderr()); + { +#ifdef USE_SFIO + /* SFIO can really mess with your errno */ + int e = errno; +#endif + PerlIO_puts(PerlIO_stderr(), message); + (void)PerlIO_flush(PerlIO_stderr()); +#ifdef USE_SFIO + errno = e; +#endif + } my_failure_exit(); /* NOTREACHED */ return 0; diff --git a/util.c b/util.c index 0b3673e..b6a9fe0 100644 --- a/util.c +++ b/util.c @@ -1349,8 +1349,17 @@ croak(const char* pat, ...) PL_restartop = die_where(message); JMPENV_JUMP(3); } - PerlIO_puts(PerlIO_stderr(),message); - (void)PerlIO_flush(PerlIO_stderr()); + { +#ifdef USE_SFIO + /* SFIO can really mess with your errno */ + int e = errno; +#endif + PerlIO_puts(PerlIO_stderr(), message); + (void)PerlIO_flush(PerlIO_stderr()); +#ifdef USE_SFIO + errno = e; +#endif + } my_failure_exit(); }