Re: [PATCH] Fix __sFILE::_lock initialization

Corinna Vinschen <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
On May 18 19:13, Sebastian Huber wrote:
> The __sFILE::_lock member is present if __SINGLE_THREAD__ is not defined.  In
> this case, it is initialized in __sfp().  It is a bug to do it sometimes also
> in std().
> ---
>  newlib/libc/stdio/findfp.c | 8 --------
>  1 file changed, 8 deletions(-)
> 
> diff --git a/newlib/libc/stdio/findfp.c b/newlib/libc/stdio/findfp.c
> index 118637a18..6933ff1db 100644
> --- a/newlib/libc/stdio/findfp.c
> +++ b/newlib/libc/stdio/findfp.c
> @@ -97,14 +97,6 @@ std (FILE *ptr,
>  #else /* _STDIO_CLOSE_STD_STREAMS */
>    ptr->_close = NULL;
>  #endif /* _STDIO_CLOSE_STD_STREAMS */
> -#if !defined(__SINGLE_THREAD__) && !(defined(_REENT_SMALL) && !defined(_REENT_GLOBAL_STDIO_STREAMS))
> -  __lock_init_recursive (ptr->_lock);
> -  /*
> -   * #else
> -   * lock is already initialized in __sfp
> -   */
> -#endif
> -
>  #ifdef __SCLE
>    if (__stextmode (ptr->_file))
>      ptr->_flags |= __SCLE;
> -- 
> 2.35.3

LGTM


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