From 05b2a10ba4187c46adef9c757e0bc01733fa06ec Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Tue, 23 Dec 2003 22:24:38 +0000 Subject: [PATCH] * fork.cc (fork_child): After a pthread/fork, ensure that impure pointer stuff which resides in parent is propagated to child thread. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/fork.cc | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 7f09dd2cc..4d285d955 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2003-12-23 Christopher Faylor + + * fork.cc (fork_child): After a pthread/fork, ensure that impure + pointer stuff which resides in parent is propagated to child thread. + 2003-12-23 Christopher Faylor * exceptions.cc (set_signal_mask): Redefine to not pass by address. diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc index 63ba7abf2..7461c0bb4 100644 --- a/winsup/cygwin/fork.cc +++ b/winsup/cygwin/fork.cc @@ -264,7 +264,8 @@ fork_child (HANDLE& hParent, dll *&first_dll, bool& load_dlls) { _main_tls = &_my_tls; _main_tls->init_thread (NULL); - // memcpy (&_main_tls->local_clib, _impure_ptr, sizeof (*_main_tls->local_lib)); + _main_tls->local_clib = *_impure_ptr; + _impure_ptr = &_main_tls->local_clib; } set_file_api_mode (current_codepage);