public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Sergey Bugaev <bugaevc@gmail.com>
To: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
Cc: "Cristian Rodríguez" <crrodriguez@opensuse.org>,
	libc-alpha@sourceware.org, bug-hurd@gnu.org,
	"Samuel Thibault" <samuel.thibault@gnu.org>
Subject: Re: [RFC PATCH 1/5] misc: Convert daemon () to GNU coding style
Date: Tue, 18 Apr 2023 21:59:51 +0300	[thread overview]
Message-ID: <CAN9u=HfCGfKu=mymfNVQibLpVFXYxdV0kK1zeUUB5b+qMMPv_w@mail.gmail.com> (raw)
In-Reply-To: <68aa3a09-7b18-e9b6-5ccd-49021419472c@linaro.org>

On Tue, Apr 18, 2023 at 9:49 PM Adhemerval Zanella Netto
<adhemerval.zanella@linaro.org> wrote:
>
>
>
> On 18/04/23 10:48, Cristian Rodríguez wrote:
> >
> >
> > On Tue, Apr 18, 2023 at 8:02 AM Adhemerval Zanella Netto via Libc-alpha <libc-alpha@sourceware.org <mailto:libc-alpha@sourceware.org>> wrote:
> >
> >
> >
> >     On 17/04/23 19:58, Sergey Bugaev via Libc-alpha wrote:
> >     > This is nicer, and is going to be required for the following changes
> >     > to reasonably stay within the 79 column limit.
> >     >
> >     > No functional change.
> >     >
> >     > Signed-off-by: Sergey Bugaev <bugaevc@gmail.com <mailto:bugaevc@gmail.com>>
> >
> >     LGTM, some minor nits below.
> >
> >     > ---
> >     >  misc/daemon.c | 88 ++++++++++++++++++++++++++++-----------------------
> >     >  1 file changed, 49 insertions(+), 39 deletions(-)
> >     >
> >     > diff --git a/misc/daemon.c b/misc/daemon.c
> >     > index 3c73ac2a..61da49b7 100644
> >     > --- a/misc/daemon.c
> >     > +++ b/misc/daemon.c
> >     > @@ -43,50 +43,60 @@ static char sccsid[] = "@(#)daemon.c      8.1 (Berkeley) 6/4/93";
> >
> >
> >     I think there is no need to ignore return code.
> >
> >
> > Also This code clearly comes from freeBSD.. which has since updated the code to ignore SIGHUP  when the parent exits.
> >
> > https://web.mit.edu/freebsd/head/lib/libc/gen/daemon.c <https://web.mit.edu/freebsd/head/lib/libc/gen/daemon.c>
>
> I think such change should be in a different patch though.

I'm going to send out a v2 of this series with the proposed changes to
daemon () included (in a separate patch from reformatting it).

It is my understanding, though, that setting and resetting the signal
handler like that is racy, since signal delivery is asynchronous. We
may get a SIGHUP some time after daemon () completes, even.

Sergey

  reply	other threads:[~2023-04-18 19:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-17 22:58 [RFC PATCH 0/5] O_IGNORE_CTTY everywhere Sergey Bugaev
2023-04-17 22:58 ` [RFC PATCH 1/5] misc: Convert daemon () to GNU coding style Sergey Bugaev
2023-04-18 12:02   ` Adhemerval Zanella Netto
2023-04-18 13:48     ` Cristian Rodríguez
2023-04-18 18:49       ` Adhemerval Zanella Netto
2023-04-18 18:59         ` Sergey Bugaev [this message]
2023-04-17 22:58 ` [RFC PATCH 2/5] Use O_CLOEXEC in more places Sergey Bugaev
2023-04-18 12:05   ` Adhemerval Zanella Netto
2023-04-17 22:58 ` [RFC PATCH 3/5] hurd: Make dl-sysdep's open () cope with O_IGNORE_CTTY Sergey Bugaev
2023-04-17 22:58 ` [RFC PATCH 4/5] include/fcntl.h: Define O_IGNORE_CTTY Sergey Bugaev
2023-04-17 22:58 ` [RFC PATCH 5/5] Use O_IGNORE_CTTY where appropriate Sergey Bugaev

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='CAN9u=HfCGfKu=mymfNVQibLpVFXYxdV0kK1zeUUB5b+qMMPv_w@mail.gmail.com' \
    --to=bugaevc@gmail.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=bug-hurd@gnu.org \
    --cc=crrodriguez@opensuse.org \
    --cc=libc-alpha@sourceware.org \
    --cc=samuel.thibault@gnu.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).