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

Sebastian Huber sebastian.huber@embedded-brains.de
Fri May 13 10:54:33 GMT 2022


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: sebastian.huber@embedded-brains.de
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/


More information about the Newlib mailing list