From: Simon Marchi <simark@simark.ca>
To: Tom Tromey <tromey@adacore.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 2/2] Use F_SETFL after F_SETOWN
Date: Wed, 12 Aug 2026 11:34:49 -0400 [thread overview]
Message-ID: <8d1ae798-aa8c-411e-8dfc-59f7f85dcef2@simark.ca> (raw)
In-Reply-To: <20260717-f-setfl-v1-2-0d1eec47cf25@adacore.com>
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.marchi@efficios.com>
Simon
next prev parent reply other threads:[~2026-08-12 15:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-17 17:07 [PATCH 0/2] Two small F_SETFL changes Tom Tromey
2026-07-17 17:07 ` [PATCH 1/2] Don't use F_SETFL in gdbreplay Tom Tromey
2026-08-12 15:31 ` Simon Marchi
2026-08-12 19:17 ` Tom Tromey
2026-07-17 17:07 ` [PATCH 2/2] Use F_SETFL after F_SETOWN Tom Tromey
2026-08-12 15:34 ` Simon Marchi [this message]
2026-08-12 19:17 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8d1ae798-aa8c-411e-8dfc-59f7f85dcef2@simark.ca \
--to=simark@simark.ca \
--cc=gdb-patches@sourceware.org \
--cc=tromey@adacore.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox