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/cygtls.cc b/winsup/cygwin/cygtls.cc
> index c8352adf9f25..0fd5509d2306 100644
> --- a/winsup/cygwin/cygtls.cc
> +++ b/winsup/cygwin/cygtls.cc
> @@ -55,16 +55,8 @@ _cygtls::init_thread (void *x, DWORD (*func) (void *, void *))
>         _REENT_INIT_PTR (&local_clib);
>         stackptr = stack;
>         altstack.ss_flags = SS_DISABLE;
> -      if (_GLOBAL_REENT)
> -	{
> -	  local_clib._stdin = _GLOBAL_REENT->_stdin;
> -	  local_clib._stdout = _GLOBAL_REENT->_stdout;
> -	  local_clib._stderr = _GLOBAL_REENT->_stderr;
> -	  if (_GLOBAL_REENT->__cleanup)
> -	    local_clib.__cleanup = _cygtls::cleanup_early;
> -	  local_clib.__sglue._niobs = 3;
> -	  local_clib.__sglue._iobs = &_GLOBAL_REENT->__sf[0];
> -	}
> +      if (_GLOBAL_REENT && _GLOBAL_REENT->__cleanup)
> +	local_clib.__cleanup = _cygtls::cleanup_early;

We have:

#define _GLOBAL_REENT (&_impure_data)

So, the NULL pointer check is superfluous.

-- 
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.