diff options
author | Christopher Faylor <me@cgf.cx> | 2003-09-20 02:43:18 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2003-09-20 02:43:18 +0000 |
commit | 370b1173b0d8bef55257fa50d393b06910d5cebc (patch) | |
tree | 3dfd8ee7652ea2eeb68c41d80ad1663831ff2214 /winsup/cygwin | |
parent | bc54734d1586e33c3c5fad736d6054585aba9359 (diff) | |
download | cygnal-370b1173b0d8bef55257fa50d393b06910d5cebc.tar.gz cygnal-370b1173b0d8bef55257fa50d393b06910d5cebc.tar.bz2 cygnal-370b1173b0d8bef55257fa50d393b06910d5cebc.zip |
* 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.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r-- | winsup/cygwin/ChangeLog | 7 | ||||
-rw-r--r-- | winsup/cygwin/thread.cc | 14 | ||||
-rw-r--r-- | winsup/cygwin/thread.h | 1 |
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 (); |