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

Corinna Vinschen <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
On May 13 07:44, Sebastian Huber wrote:
> 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.

Oh, right, thanks!


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