1
0
mirror of https://sourceware.org/git/glibc.git synced 2026-01-06 11:51:29 +03:00

Fix perror fileno namespace (bug 17633).

perror, an ISO C function, uses fileno, which is not an ISO C
function.  This patch makes it use __fileno instead.  (The nearby call
to fdopen is not a problem because that's #defined to _IO_new_fdopen.)

Tested for x86_64 (testsuite, and that installed stripped shared
libraries are unchanged by this patch).

	[BZ #17633]
	* stdio-common/perror.c (perror): Call __fileno instead of fileno.
	* conform/Makefile (test-xfail-ISO/stdio.h/linknamespace): Remove
	variable.
	(test-xfail-ISO99/stdio.h/linknamespace): Likewise.
	(test-xfail-ISO11/stdio.h/linknamespace): Likewise.
This commit is contained in:
Joseph Myers
2014-11-24 15:59:15 +00:00
parent 6423d4754c
commit 9744496f8a
4 changed files with 11 additions and 5 deletions

View File

@@ -56,7 +56,7 @@ perror (const char *s)
oriented yet? In this case we'll create a new stream which is
using the same underlying file descriptor. */
if (__builtin_expect (_IO_fwide (stderr, 0) != 0, 1)
|| (fd = fileno (stderr)) == -1
|| (fd = __fileno (stderr)) == -1
|| (fd = __dup (fd)) == -1
|| (fp = fdopen (fd, "w+")) == NULL)
{