From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1921) id C39993857C4A; Thu, 19 May 2022 17:02:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C39993857C4A Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Sebastian Huber To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] Fix __sFILE::_lock initialization X-Act-Checkin: newlib-cygwin X-Git-Author: Sebastian Huber X-Git-Refname: refs/heads/master X-Git-Oldrev: 1b86dd7d8c193bca46f08c8f900ae9678c8331d5 X-Git-Newrev: 382550072b49430f8c69adee937a0ba07bd385e6 Message-Id: <20220519170226.C39993857C4A@sourceware.org> Date: Thu, 19 May 2022 17:02:26 +0000 (GMT) X-BeenThere: newlib-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib GIT logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2022 17:02:26 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D382550072b4= 9430f8c69adee937a0ba07bd385e6 commit 382550072b49430f8c69adee937a0ba07bd385e6 Author: Sebastian Huber Date: Tue May 17 16:39:34 2022 +0200 Fix __sFILE::_lock initialization =20 The __sFILE::_lock member is present if __SINGLE_THREAD__ is not define= d. In this case, it is initialized in __sfp(). It is a bug to do it sometime= s also in std(). Diff: --- 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 =3D NULL; #endif /* _STDIO_CLOSE_STD_STREAMS */ -#if !defined(__SINGLE_THREAD__) && !(defined(_REENT_SMALL) && !defined(_RE= ENT_GLOBAL_STDIO_STREAMS)) - __lock_init_recursive (ptr->_lock); - /* - * #else - * lock is already initialized in __sfp - */ -#endif - #ifdef __SCLE if (__stextmode (ptr->_file)) ptr->_flags |=3D __SCLE;