summaryrefslogtreecommitdiffstats
path: root/main/uclibc/uclibc-linuxthreads-init-stdio.patch
blob: aa5ef64600437363ebf860a1a78ca059f419b681 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/libpthread/linuxthreads/pthread.c b/libpthread/linuxthreads/pthread.c
index 6ae9a10..151e039 100644
--- a/libpthread/linuxthreads/pthread.c
+++ b/libpthread/linuxthreads/pthread.c
@@ -409,6 +409,16 @@ cannot allocate TLS data structures for initial thread\n";
 #endif
 
   __libc_multiple_threads_ptr = __libc_pthread_init (ptr_pthread_functions);
+  /* uClibc-specific stdio initialization for threads. */
+  {
+    FILE *fp;
+    _stdio_user_locking = 0;       /* 2 if threading not initialized */
+    for (fp = _stdio_openlist; fp != NULL; fp = fp->__nextopen) {
+      if (fp->__user_locking != 1) {
+        fp->__user_locking = 0;
+      }
+    }
+  }
 }