From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x29.google.com (mail-oa1-x29.google.com [IPv6:2001:4860:4864:20::29]) by sourceware.org (Postfix) with ESMTPS id 5B9DC3858D1E for ; Tue, 18 Apr 2023 19:00:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5B9DC3858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oa1-x29.google.com with SMTP id 586e51a60fabf-18777914805so5553679fac.1 for ; Tue, 18 Apr 2023 12:00:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681844402; x=1684436402; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=SeK8dhGTtjNXkyWkkRq/qNe3D9gApslwkdCzZ1F2kDw=; b=C6c7zoxkUvj0u3kxvE8YF0WuCrDbN451aOf4LRzKrqEgKxTigKk2RMdI+7IjrDjver Slvd/1ybT/RqCGvbQrP1LyDl0OKK0d7n9t9+S4sPB11wlPokCgeEnla88uRHrzlrzNdD C/Z+6yK9T72Ywc0SOmevfIw9ColWcqkHWax+XWJBqzATnL/nBgX/65SfdKLnAJF2Qi5+ fCJFG81QbKPQVxqRQI0aptxdZOBfFwyhrGglm9ed6H5V3d3OeJn0KC/jrJmtu4pPRiYK rSlE/2s3+mfjjSZoos5WjrJbPsT85MHNvhGz/VnfZgIQq/iWDR4jLmm+il31Z1K+Bso9 nzKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681844402; x=1684436402; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SeK8dhGTtjNXkyWkkRq/qNe3D9gApslwkdCzZ1F2kDw=; b=dPYkDHhQFVq8SvqzHcAotPWFg2nqbuJU74+QwY3xrVyE+njQ8MnC+qLGHfrNJSeUhW agru4JC0SJGuQ4CPsgLTF33ogHjZYpzx1eQKS1IJwZ8vXnnC0nWYwjXLP5lxteMS8Dw8 CbiUj/IOXmYYZ37sPAaR45uk9BJqCz2qcXIGaZoSdE3WRz09Ya5816rxaYtZQDyTcdts EB+oh8vHGWYZ0dnf0T/eBcrTuCjIs7vsGagTy6IgfUMSLWQDKQfVr5sSTbpPGEH7btRv aHdY7T3lm0qTINNMJvfPpZRM63AFJGY+6BGHFWpS38LyDs1B9cxRcEysmKMDdmAArfe2 YVOw== X-Gm-Message-State: AAQBX9eo2RVqkhUYo7/S0wZklhBaVqCsTud6UU8vj1Fvmiy85d5hbNdJ GnWDSBTr4FroMbnpRCtBMuxHOlGV0O1QWze0wCo= X-Google-Smtp-Source: AKy350YXscTpID0JQmPmmsjIcvySUjPiNXvy4hxxzARRIOVVbQrF5OZnuSUd8F6JGx9I1lvdIJ3Vx315U1nOd1tymzY= X-Received: by 2002:a05:6830:1c9:b0:6a4:47d5:5121 with SMTP id r9-20020a05683001c900b006a447d55121mr1100239ota.2.1681844402542; Tue, 18 Apr 2023 12:00:02 -0700 (PDT) MIME-Version: 1.0 References: <20230417225857.2006561-1-bugaevc@gmail.com> <20230417225857.2006561-2-bugaevc@gmail.com> <19b6b831-49c5-4db4-292c-349d36bb16ce@linaro.org> <68aa3a09-7b18-e9b6-5ccd-49021419472c@linaro.org> In-Reply-To: <68aa3a09-7b18-e9b6-5ccd-49021419472c@linaro.org> From: Sergey Bugaev Date: Tue, 18 Apr 2023 21:59:51 +0300 Message-ID: Subject: Re: [RFC PATCH 1/5] misc: Convert daemon () to GNU coding style To: Adhemerval Zanella Netto Cc: =?UTF-8?Q?Cristian_Rodr=C3=ADguez?= , libc-alpha@sourceware.org, bug-hurd@gnu.org, Samuel Thibault Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE,URI_DOTEDU autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Tue, Apr 18, 2023 at 9:49=E2=80=AFPM Adhemerval Zanella Netto wrote: > > > > On 18/04/23 10:48, Cristian Rodr=C3=ADguez wrote: > > > > > > On Tue, Apr 18, 2023 at 8:02=E2=80=AFAM Adhemerval Zanella Netto via Li= bc-alpha > wro= te: > > > > > > > > On 17/04/23 19:58, Sergey Bugaev via Libc-alpha wrote: > > > This is nicer, and is going to be required for the following chan= ges > > > to reasonably stay within the 79 column limit. > > > > > > No functional change. > > > > > > Signed-off-by: Sergey Bugaev > > > > > 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[] =3D "@(#)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 > > 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