From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id OT2SKrmSfGp5uyAAWB0awg (envelope-from ) for ; Wed, 12 Aug 2026 11:35:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1786548921; bh=BrkPnh0mc9NkqUtSwVYoOk6XsdAv+ewVKX/61u+t2IU=; h=Date:Subject:To:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=htQAD4IXWsvza/SAJrWxgRIH05KJelYO6+PkPTkinWZfyN6k+LJH247HTu3ldGHTO 43cM30IWKdkOPjYONtcheIzv86zrfNNYo3IZJ2XPZw2kJ1Q2X9mCkRcyMZ121mlkbL wwkvZ/hZtS/O0wuwEJkMYnjqfyD6GgqZr+i0QTv8= Received: by simark.ca (Postfix, from userid 112) id A88311E166; Wed, 12 Aug 2026 11:35:21 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=tN8sEGaV; dkim-atps=neutral Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 4645E1E09B for ; Wed, 12 Aug 2026 11:35:21 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D54BC4BA23E4 for ; Wed, 12 Aug 2026 15:35:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D54BC4BA23E4 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=tN8sEGaV Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 152254BA2E09 for ; Wed, 12 Aug 2026 15:34:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 152254BA2E09 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 152254BA2E09 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1786548891; cv=none; b=nLwmGq82qVZDosG7G/eBYAT55Cx9dD/FiNhEgEHG/sYQxiw9cqp8p0t7GFXFtFbIJyVNmAjdPQJX0u+cKSJhSFTKnZh30rzsAxltOPaSVzioGKhputMuoHuSHBeQXQcjk/QVOKw5Aml9Mvo7S6zA/WIZZ7DTERxFylc8yIUsm6k= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1786548891; c=relaxed/simple; bh=BrkPnh0mc9NkqUtSwVYoOk6XsdAv+ewVKX/61u+t2IU=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=gHH5Hee7HDjTiUyTNl/YyZf8ewZoTWXzCeGLuBK8dVjljR+ufmz0J6OxRWsujoUJSwlNUCeeBeeiOJG5I35jGAzsCSLU7Q+TJXws7mDJ3h7VYn7EtRSz4/PYzm3260OvmbDYl38mi7UiEGVcrxeuaGHI96oZ4v04QtVGFNZgPK0= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=tN8sEGaV DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 152254BA2E09 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1786548890; bh=BrkPnh0mc9NkqUtSwVYoOk6XsdAv+ewVKX/61u+t2IU=; h=Date:Subject:To:References:From:In-Reply-To:From; b=tN8sEGaVdU78qrlv+S4Y4K5B3wmo+afVXLTA4iNZcEC2ZmymJbNr8FCSC51hYetZr +//FeWJmYphzVnZdXsu9P88kM/JazbqCHUiNKYJIXTdB2LdEcvg/e1Up/eAdydJMQ9 pD0cX9Sdta0J3l2q43AACi32PMda5RtlSL1rHFyw= Received: by simark.ca (Postfix) id 45A311E09B; Wed, 12 Aug 2026 11:34:50 -0400 (EDT) Message-ID: <8d1ae798-aa8c-411e-8dfc-59f7f85dcef2@simark.ca> Date: Wed, 12 Aug 2026 11:34:49 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] Use F_SETFL after F_SETOWN To: Tom Tromey , gdb-patches@sourceware.org References: <20260717-f-setfl-v1-0-0d1eec47cf25@adacore.com> <20260717-f-setfl-v1-2-0d1eec47cf25@adacore.com> Content-Language: fr From: Simon Marchi In-Reply-To: <20260717-f-setfl-v1-2-0d1eec47cf25@adacore.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 7/17/26 1:07 PM, Tom Tromey wrote: > This changes enable_async_notification to use F_SETFL after F_SETOWN. > This order more correct because it ensures that the owning process is Missing "is". > set before the request to enable SIGIO. > --- > gdbserver/remote-utils.cc | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/gdbserver/remote-utils.cc b/gdbserver/remote-utils.cc > index ffde4956776..e92adf903ce 100644 > --- a/gdbserver/remote-utils.cc > +++ b/gdbserver/remote-utils.cc > @@ -128,13 +128,11 @@ static void > enable_async_notification (int fd) > { > #if defined(F_SETFL) && defined (FASYNC) > - int save_fcntl_flags; > - > - save_fcntl_flags = fcntl (fd, F_GETFL, 0); > - fcntl (fd, F_SETFL, save_fcntl_flags | FASYNC); > #if defined (F_SETOWN) > fcntl (fd, F_SETOWN, getpid ()); > #endif > + int save_fcntl_flags = fcntl (fd, F_GETFL, 0); > + fcntl (fd, F_SETFL, save_fcntl_flags | FASYNC); While touching these lines, could you maybe indent the inner #if and #endif? Like: #if defined(F_SETFL) && defined (FASYNC) # if defined (F_SETOWN) fcntl (fd, F_SETOWN, getpid ()); # endif int save_fcntl_flags = fcntl (fd, F_GETFL, 0); fcntl (fd, F_SETFL, save_fcntl_flags | FASYNC); #endif Approved-By: Simon Marchi Simon