From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 5FF30385803E for ; Fri, 13 May 2022 07:53:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5FF30385803E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652428385; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=QJ4mDg9+VNvgkCEcggvlEdMwwDleuFw0FInLYYL3g5s=; b=jGILesHRey40F1kVGenf9ucFwJPQsALK22WoW899gyNnNGbc7QQNiUunQtZhQ8qbHUxjCd kxI/WnPaO8gu3E5saZfiFu4XOhaD4xcJ9LGPJcb3hin/l2UGclEIGMUWvKj+2LNKyckMMx DkPdou6dKC8cPWTo1INgG/hGdiMeEzY= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-150-W122kn_BMmydCxtWnl1P4w-1; Fri, 13 May 2022 03:53:03 -0400 X-MC-Unique: W122kn_BMmydCxtWnl1P4w-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AE9202919EBB for ; Fri, 13 May 2022 07:53:03 +0000 (UTC) Received: from calimero.vinschen.de (unknown [10.36.112.8]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 89D50111E3E6 for ; Fri, 13 May 2022 07:53:03 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id 41879A80571; Fri, 13 May 2022 09:53:02 +0200 (CEST) Date: Fri, 13 May 2022 09:53:02 +0200 From: Corinna Vinschen To: newlib@sourceware.org Subject: Re: [PATCH v2 00/11] Decouple global file object list from _GLOBAL_REENT Message-ID: Reply-To: newlib@sourceware.org Mail-Followup-To: newlib@sourceware.org References: <20220512121143.21473-1-matthew.joyce@embedded-brains.de> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=vinschen@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, 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: Fri, 13 May 2022 07:53:06 -0000 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