about summary refs log tree commit diff
path: root/dirent
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2014-11-12 16:24:16 +0000
committerJoseph Myers <joseph@codesourcery.com>2014-11-12 16:24:16 +0000
commit2f5c1b000aaeb2c25b1df52453bba8de7f9453e2 (patch)
tree523dac74393fcf0967b6b7ec683848b4dfbed877 /dirent
parent5a6fa4d7ed465c2f7da9d73004c972519dc2100e (diff)
downloadglibc-2f5c1b000aaeb2c25b1df52453bba8de7f9453e2.tar.gz
glibc-2f5c1b000aaeb2c25b1df52453bba8de7f9453e2.tar.xz
glibc-2f5c1b000aaeb2c25b1df52453bba8de7f9453e2.zip
Fix __getcwd rewinddir namespace (bug 17584).
__getcwd is called from dcigettext.o (brought in by various ISO C
functionality), but calls rewinddir, which is not an ISO C function.
This patch makes __getcwd call __rewinddir instead and makes rewinddir
a weak alias for __rewinddir.

Since getcwd.c is shared with gnulib (albeit not merged in either
direction for a long time, and omitted from gnulib's
config/srclist.txt list of shared files) I put in a #ifndef _LIBC
define of __rewinddir to rewinddir, although a future merged version
of getcwd could end up looking significantly different.

Tested for x86_64 (testsuite, and that disassembly of installed shared
libraries is unchanged by this patch).

	[BZ #17584]
	* dirent/rewinddir.c (rewinddir): Rename to __rewinddir and define
	as weak alias of __rewinddir.  Don't use libc_hidden_def.
	(__rewinddir): Use libc_hidden_def.
	* sysdeps/mach/hurd/rewinddir.c: Rename to __rewinddir and define
	as weak alias of __rewinddir.  Don't use libc_hidden_def.
	(__rewinddir): Use libc_hidden_def.
	* sysdeps/posix/rewinddir.c: Rename to __rewinddir and define as
	weak alias of __rewinddir.  Don't use libc_hidden_def.
	(__rewinddir): Use libc_hidden_def.
	* include/dirent.h (rewinddir): Don't use libc_hidden_proto.
	(__rewinddir): Use libc_hidden_proto.
	* sysdeps/posix/getcwd.c [!_LIBC] (__rewinddir): Define to
	rewinddir.
	(__getcwd): Use __rewinddir instead of rewinddir.
Diffstat (limited to 'dirent')
-rw-r--r--dirent/rewinddir.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/dirent/rewinddir.c b/dirent/rewinddir.c
index 86d9fbd720..ba5b002ce0 100644
--- a/dirent/rewinddir.c
+++ b/dirent/rewinddir.c
@@ -22,13 +22,14 @@
 
 /* Rewind DIRP to the beginning of the directory.  */
 void
-rewinddir (dirp)
+__rewinddir (dirp)
      DIR *dirp;
 {
   __set_errno (ENOSYS);
   /* No way to indicate failure.	*/
 }
-libc_hidden_def (rewinddir)
+libc_hidden_def (__rewinddir)
+weak_alias (__rewinddir, rewinddir)
 
 
 stub_warning (rewinddir)