]> sourceware.org Git - newlib-cygwin.git/commitdiff
Fix __sFILE::_lock initialization
authorSebastian Huber <sebastian.huber@embedded-brains.de>
Tue, 17 May 2022 14:39:34 +0000 (16:39 +0200)
committerSebastian Huber <sebastian.huber@embedded-brains.de>
Thu, 19 May 2022 17:01:49 +0000 (19:01 +0200)
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

index 118637a18f5bbdb333b2ba13ab62d59cad3bcbc5..6933ff1dbcefeb93a79fe7ab59d72b1036976698 100644 (file)
@@ -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;
This page took 0.030105 seconds and 5 git commands to generate.