mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
Fix getpass fflush_unlocked namespace (bug 18540).
The getpass function (XPG3 / XPG4 / UNIX98) calls fflush_unlocked (not in any of those standards). This patch fixes this by making fflush_unlocked into a weak alias for __fflush_unlocked and calling __fflush_unlocked from getpass. Tested for x86_64 and x86 (testsuite, and that disassembly of installed stripped shared libraries is unchanged by the patch). [BZ #18540] * libio/iofflush.c [!_IO_MTSAFE_IO] (__fflush_unlocked): Define as strong alias of _IO_fflush. Use libc_hidden_def. * libio/iofflush_u.c (fflush_unlocked): Rename to __fflush_unlocked and define as weak alias of __fflush_unlocked. Use libc_hidden_weak. * include/stdio.h (__fflush_unlocked): Declare. Use libc_hidden_proto. * misc/getpass.c (getpass): Call __fflush_unlocked instead of fflush_unlocked. * conform/Makefile (test-xfail-UNIX98/unistd.h/linknamespace): Remove variable.
This commit is contained in:
@ -28,7 +28,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int
|
||||
fflush_unlocked (fp)
|
||||
__fflush_unlocked (fp)
|
||||
_IO_FILE *fp;
|
||||
{
|
||||
if (fp == NULL)
|
||||
@ -39,4 +39,6 @@ fflush_unlocked (fp)
|
||||
return _IO_SYNC (fp) ? EOF : 0;
|
||||
}
|
||||
}
|
||||
libc_hidden_def (fflush_unlocked)
|
||||
libc_hidden_def (__fflush_unlocked)
|
||||
weak_alias (__fflush_unlocked, fflush_unlocked)
|
||||
libc_hidden_weak (fflush_unlocked)
|
||||
|
Reference in New Issue
Block a user