OSDN Git Service
(root)
/
uclinux-h8
/
uclibc-ng.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7129c31
)
Fix opendir problem when statically linked due to a missing
author
Carmelo Amoroso
<carmelo.amoroso@st.com>
Wed, 5 Dec 2007 17:25:04 +0000
(17:25 -0000)
committer
Carmelo Amoroso
<carmelo.amoroso@st.com>
Wed, 5 Dec 2007 17:25:04 +0000
(17:25 -0000)
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@st.com>
libc/misc/dirent/opendir.c
patch
|
blob
|
history
diff --git
a/libc/misc/dirent/opendir.c
b/libc/misc/dirent/opendir.c
index
338bef1
..
cee703e
100644
(file)
--- a/
libc/misc/dirent/opendir.c
+++ b/
libc/misc/dirent/opendir.c
@@
-64,6
+64,7
@@
close_and_ret:
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;