From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dedi548.your-server.de (dedi548.your-server.de [85.10.215.148]) by sourceware.org (Postfix) with ESMTPS id D31203858025 for ; Wed, 18 May 2022 17:13:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D31203858025 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embedded-brains.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embedded-brains.de Received: from sslproxy01.your-server.de ([78.46.139.224]) by dedi548.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nrNEV-0000E4-3g for newlib@sourceware.org; Wed, 18 May 2022 19:13:11 +0200 Received: from [82.100.198.138] (helo=mail.embedded-brains.de) by sslproxy01.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nrNEV-000HN4-10 for newlib@sourceware.org; Wed, 18 May 2022 19:13:11 +0200 Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id B9F94480156 for ; Wed, 18 May 2022 19:13:10 +0200 (CEST) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id HcUramjg1fX6 for ; Wed, 18 May 2022 19:13:10 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 65585480167 for ; Wed, 18 May 2022 19:13:10 +0200 (CEST) X-Virus-Scanned: amavisd-new at zimbra.eb.localhost Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Gn9XhWrIhTyK for ; Wed, 18 May 2022 19:13:10 +0200 (CEST) Received: from zimbra.eb.localhost (unknown [192.168.96.242]) by mail.embedded-brains.de (Postfix) with ESMTPSA id 3EF00480156 for ; Wed, 18 May 2022 19:13:10 +0200 (CEST) From: Sebastian Huber To: newlib@sourceware.org Subject: [PATCH] Fix __sFILE::_lock initialization Date: Wed, 18 May 2022 19:13:06 +0200 Message-Id: <20220518171307.53663-2-sebastian.huber@embedded-brains.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220518171307.53663-1-sebastian.huber@embedded-brains.de> References: <20220518171307.53663-1-sebastian.huber@embedded-brains.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Authenticated-Sender: smtp-embedded@poldinet.de X-Virus-Scanned: Clear (ClamAV 0.103.5/26545/Wed May 18 10:03:47 2022) X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2022 17:13:14 -0000 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 =3D 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 |=3D __SCLE; --=20 2.35.3