svn commit: branches/uClibc-nptl/libc/misc/dirent
carmelo at uclibc.org
carmelo at uclibc.org
Wed Dec 5 17:25:09 UTC 2007
Author: carmelo
Date: 2007-12-05 09:25:08 -0800 (Wed, 05 Dec 2007)
New Revision: 20626
Log:
Fix opendir problem when statically linked due to a missing
initialization of the mutex field within DIR struct.
When linked dynamically instead, __pthread_mutex_init will
initialize the mutex itself. Without this fix, any call to
readdir will stuck forever trying to acquire the mutex.
Signed-off-by: Carmelo Amoroso <carmelo.amoroso at st.com>
Modified:
branches/uClibc-nptl/libc/misc/dirent/opendir.c
Changeset:
Modified: branches/uClibc-nptl/libc/misc/dirent/opendir.c
===================================================================
--- branches/uClibc-nptl/libc/misc/dirent/opendir.c 2007-12-05 17:25:04 UTC (rev 20625)
+++ branches/uClibc-nptl/libc/misc/dirent/opendir.c 2007-12-05 17:25:08 UTC (rev 20626)
@@ -75,6 +75,7 @@
if (!(ptr = malloc(sizeof(*ptr))))
goto nomem_close_and_ret;
+ memset(ptr, '\0', sizeof(DIR));
ptr->dd_fd = fd;
ptr->dd_nextloc = ptr->dd_size = ptr->dd_nextoff = 0;
More information about the uClibc-cvs
mailing list