diff options
author | H.Merijn Brand <h.m.brand@xs4all.nl> | 2016-08-19 20:44:14 +0200 |
---|---|---|
committer | H.Merijn Brand <h.m.brand@xs4all.nl> | 2016-08-19 20:44:14 +0200 |
commit | 675c73ca278d0bfeffeeb2a3f4cdea82e8b8b8c4 (patch) | |
tree | 61560f1cba841c52a449db170969bf71ee9d7c89 /perl.c | |
parent | 9fb994be1361ac6bc42256ee6a710159cf050ca5 (diff) | |
download | perl-675c73ca278d0bfeffeeb2a3f4cdea82e8b8b8c4.tar.gz |
Do not show error message if errno = 0 for flush fail on STDOUT
Somehow (on HP-UX Itanium) the flush fails, but errno is still 0
The lib/warnings.t test then shows
EXPECTED:
Filehandle STDOUT opened only for output at - line 3.
GOT:
Filehandle STDOUT opened only for output at - line 3.
Unable to flush stdout: Error 0
This change suppresses that last line if errno is (still) 0
Diffstat (limited to 'perl.c')
-rw-r--r-- | perl.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -621,8 +621,9 @@ perl_destruct(pTHXx) PerlIO *stdo = PerlIO_stdout(); if (*stdo && PerlIO_flush(stdo)) { PerlIO_restore_errno(stdo); - PerlIO_printf(PerlIO_stderr(), "Unable to flush stdout: %s", - Strerror(errno)); + if (errno) + PerlIO_printf(PerlIO_stderr(), "Unable to flush stdout: %s", + Strerror(errno)); if (!STATUS_UNIX) STATUS_ALL_FAILURE; } |