svn commit: branches/uClibc_0_9_29/libc/misc/dirent

vapier at uclibc.org vapier at uclibc.org
Sat Jan 5 09:58:22 PST 2008


Author: vapier
Date: 2008-01-05 09:58:22 -0800 (Sat, 05 Jan 2008)
New Revision: 20796

Log:
Merge r20625 by carmelo from trunk:
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_0_9_29/libc/misc/dirent/opendir.c


Changeset:
Modified: branches/uClibc_0_9_29/libc/misc/dirent/opendir.c
===================================================================
--- branches/uClibc_0_9_29/libc/misc/dirent/opendir.c	2008-01-05 17:57:57 UTC (rev 20795)
+++ branches/uClibc_0_9_29/libc/misc/dirent/opendir.c	2008-01-05 17:58:22 UTC (rev 20796)
@@ -64,6 +64,7 @@
 	if (!(ptr = malloc(sizeof(*ptr))))
 		goto nomem_close_and_ret;
 
+	memset(ptr, '\0', sizeof(DIR));
 	ptr->dd_fd = fd;
 
 	ptr->dd_max = statbuf.st_blksize;



More information about the uClibc-cvs mailing list