fix missing flush of stderr at exit if it was put in buffered mode
authorRich Felker <dalias@aerifal.cx>
Thu, 30 Aug 2018 03:40:49 +0000 (23:40 -0400)
committerRich Felker <dalias@aerifal.cx>
Thu, 30 Aug 2018 03:40:49 +0000 (23:40 -0400)
commit 0b80a7b0404b6e49b0b724e3e3fe0ed5af3b08ef added the ability to
set application-provided stdio FILE buffers, adding the possibility
that stderr might be buffered at exit time, but __stdio_exit did not
have code to flush it.

this regression was not present in any release.

src/stdio/__stdio_exit.c

index 191b4454a48d3ff4258c2cd6dd5d29738d79620e..5741070f79118c42eced380bff2ce09b877d1071 100644 (file)
@@ -19,6 +19,7 @@ void __stdio_exit(void)
        for (f=*__ofl_lock(); f; f=f->next) close_file(f);
        close_file(__stdin_used);
        close_file(__stdout_used);
+       close_file(__stderr_used);
 }
 
 weak_alias(__stdio_exit, __stdio_exit_needed);