Update.
[kopensolaris-gnu/glibc.git] / linuxthreads / ptfork.c
index 440d66c..564f8d7 100644 (file)
@@ -20,6 +20,7 @@
 #include <unistd.h>
 #include "pthread.h"
 #include "internals.h"
+#include <bits/libc-lock.h>
 
 struct handler_list {
   void (*handler)(void);
@@ -83,6 +84,7 @@ pid_t __fork(void)
 
   pthread_call_handlers(pthread_atfork_prepare);
   __pthread_once_fork_prepare();
+  __flockfilelist();
 
   pid = __libc_fork();
 
@@ -95,6 +97,7 @@ pid_t __fork(void)
 
     pthread_mutex_init(&pthread_atfork_lock, NULL);
   } else {
+    __funlockfilelist();
     __pthread_once_fork_parent();
     pthread_call_handlers(pthread_atfork_parent);