Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-09-20 06:43:18 +0400
committerChristopher Faylor <me@cgf.cx>2003-09-20 06:43:18 +0400
commit370b1173b0d8bef55257fa50d393b06910d5cebc (patch)
tree3dfd8ee7652ea2eeb68c41d80ad1663831ff2214
parentbc54734d1586e33c3c5fad736d6054585aba9359 (diff)
* thread.h (__reent_t::init_clib): Declare new function.
* thread.cc (__reent_t::init_clib): Define new function. (pthread::thread_init_wrapper): Use __reent_t::init_clib to init local clib storage and set std{in,out,err} appropriately.
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/thread.cc14
-rw-r--r--winsup/cygwin/thread.h1
3 files changed, 20 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 6d794a3e2..63e0ff792 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,12 @@
2003-09-19 Christopher Faylor <cgf@redhat.com>
+ * thread.h (__reent_t::init_clib): Declare new function.
+ * thread.cc (__reent_t::init_clib): Define new function.
+ (pthread::thread_init_wrapper): Use __reent_t::init_clib to init local
+ clib storage and set std{in,out,err} appropriately.
+
+2003-09-19 Christopher Faylor <cgf@redhat.com>
+
* syscalls.cc (system): Strip signal considerations from here so that
they are not inherited by a child process.
* spawn.cc (spawn_guts): Handle system() signal stuff here.
diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc
index 2304b7b42..6931b3914 100644
--- a/winsup/cygwin/thread.cc
+++ b/winsup/cygwin/thread.cc
@@ -1769,6 +1769,16 @@ verifyable_object_isvalid (void const * objectptr, long magic)
return verifyable_object_isvalid (objectptr, magic, NULL);
}
+inline void
+__reent_t::init_clib (struct _reent& var)
+{
+ var = ((struct _reent) _REENT_INIT (var));
+ var._stdin = _GLOBAL_REENT->_stdin;
+ var._stdout = _GLOBAL_REENT->_stdout;
+ var._stderr = _GLOBAL_REENT->_stderr;
+ _clib = &var;
+};
+
/* Pthreads */
void *
pthread::thread_init_wrapper (void *_arg)
@@ -1778,7 +1788,7 @@ pthread::thread_init_wrapper (void *_arg)
pthread *thread = (pthread *) _arg;
struct __reent_t local_reent;
struct _winsup_t local_winsup;
- struct _reent local_clib = _REENT_INIT (local_clib);
+ struct _reent local_clib;
struct sigaction _sigs[NSIG];
sigset_t _sig_mask; /* one set for everything to ignore. */
@@ -1791,7 +1801,7 @@ pthread::thread_init_wrapper (void *_arg)
memset (&local_winsup, 0, sizeof (struct _winsup_t));
- local_reent._clib = &local_clib;
+ local_reent.init_clib (local_clib);
local_reent._winsup = &local_winsup;
local_winsup._process_logmask = LOG_UPTO (LOG_DEBUG);
diff --git a/winsup/cygwin/thread.h b/winsup/cygwin/thread.h
index ea1f13f44..a52c0b771 100644
--- a/winsup/cygwin/thread.h
+++ b/winsup/cygwin/thread.h
@@ -108,6 +108,7 @@ struct __reent_t
{
struct _reent *_clib;
struct _winsup_t *_winsup;
+ void init_clib (_reent&);
};
_winsup_t *_reent_winsup ();