Re: [PATCH v2 00/11] Decouple global file object list from _GLOBAL_REENT

Sebastian Huber <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
On 12/05/2022 21:44, Corinna Vinschen wrote:
> diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc
> index 5f460d8a5c78..6b816763e002 100644
> --- a/winsup/cygwin/dcrt0.cc
> +++ b/winsup/cygwin/dcrt0.cc
> @@ -757,9 +757,7 @@ dll_crt0_0 ()
>   
>     lock_process::init ();
>     _impure_ptr = _GLOBAL_REENT;
> -  _impure_ptr->_stdin = &_impure_ptr->__sf[0];
> -  _impure_ptr->_stdout = &_impure_ptr->__sf[1];
> -  _impure_ptr->_stderr = &_impure_ptr->__sf[2];
> +  _REENT_INIT_PTR_ZEROED (_GLOBAL_REENT);
>     user_data->impure_ptr = _impure_ptr;
>     user_data->impure_ptr_ptr = &_impure_ptr;
>   

The _GLOBAL_REENT == (&_impure_data) is statically initialized in impure.c:

struct _reent __ATTRIBUTE_IMPURE_DATA__ _impure_data = _REENT_INIT 
(_impure_data);

I guess you don't need the _REENT_INIT_PTR_ZEROED (_GLOBAL_REENT).

-- 
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: [email protected]
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.