svn commit: branches/uClibc-nptl: libc/misc/dirent libpthread/nptl

carmelo at uclibc.org carmelo at uclibc.org
Wed Sep 3 10:03:30 UTC 2008


Author: carmelo
Date: 2008-09-03 03:03:29 -0700 (Wed, 03 Sep 2008)
New Revision: 23310

Log:
Make sure that multi-threaded statically linked applications use the real
locking implementations instead of the empty stubs from libc.a.

Removed also old work-around added to opendir, due to wrong 
pthread_mutex_init (from libc.a) used in static binaries.

Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono at st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso at st.com>


Modified:
   branches/uClibc-nptl/libc/misc/dirent/opendir.c
   branches/uClibc-nptl/libpthread/nptl/pthread_create.c


Changeset:
Modified: branches/uClibc-nptl/libc/misc/dirent/opendir.c
===================================================================
--- branches/uClibc-nptl/libc/misc/dirent/opendir.c	2008-09-03 06:58:28 UTC (rev 23309)
+++ branches/uClibc-nptl/libc/misc/dirent/opendir.c	2008-09-03 10:03:29 UTC (rev 23310)
@@ -75,9 +75,8 @@
 	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;
 	ptr->dd_max = statbuf.st_blksize;
 	if (ptr->dd_max < 512)
 		ptr->dd_max = 512;

Modified: branches/uClibc-nptl/libpthread/nptl/pthread_create.c
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/pthread_create.c	2008-09-03 06:58:28 UTC (rev 23309)
+++ branches/uClibc-nptl/libpthread/nptl/pthread_create.c	2008-09-03 10:03:29 UTC (rev 23310)
@@ -477,3 +477,8 @@
 PTHREAD_STATIC_FN_REQUIRE (pthread_key_create)
 PTHREAD_STATIC_FN_REQUIRE (pthread_setspecific)
 PTHREAD_STATIC_FN_REQUIRE (pthread_getspecific)
+
+/* UCLIBC_MUTEX_xxx macros expects to have these as well */
+PTHREAD_STATIC_FN_REQUIRE (pthread_mutex_init)
+PTHREAD_STATIC_FN_REQUIRE (_pthread_cleanup_push_defer)
+PTHREAD_STATIC_FN_REQUIRE (_pthread_cleanup_pop_restore)




More information about the uClibc-cvs mailing list