From nobody Wed Dec 27 15:48:16 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T0bdn1lw1z55r5s for ; Wed, 27 Dec 2023 15:48:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4T0bdm70yCz3Mbm for ; Wed, 27 Dec 2023 15:48:28 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a2358a75b69so914474666b.1 for ; Wed, 27 Dec 2023 07:48:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1703692107; x=1704296907; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=B47247NUMYKIYNLWcezwCcPD2Y/w2a/u1iNsFFSMoMw=; b=oCuHO03zjKF8wA2Yaz/by5kaJo4o7LjtCoCXN2zh89t7pAi314+gJoXr4r1HuNJkJb eNMCoRiX9rOCtzmwTACPdxS0zoJkd349QHcMoOW4I4ixpzumSYDD/2Gj82M5uccXwxK3 qTBOANRnBL3fvvtqpSZj9EN6yTYpLiYjI1bFVRfbME5YK3QPCmrMkSIlAK0GYKBz+A3T OLWrc4Vq67J7GtlRSOFP6p0EEalX+YHJvfU4cuAkgr27O5EYoz5fTt6dql50LHwiDcWn mFuZDIqEzhowcqYEmT3W2aBSeWLLQSlECLctoGdTjxDz/OSndHoiyrLVuxZbYWa14zY5 hLEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703692107; x=1704296907; h=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=B47247NUMYKIYNLWcezwCcPD2Y/w2a/u1iNsFFSMoMw=; b=nJ1dK9dAiR+qAT4wTB8Nkt/hXCV0sDJndVjb0FB0Atb1tyeGEdVYllii/+aJcuq5o0 gyrsl73zkR4rQ/OWllPxW6SZVpQg8TIWS1RJuZTXX1zQN7kpWYV3sFMQNdtGNNfnbDZq LKhvyr3lp/zGDI5C/Vorr+YtECG7a0Avl4mniRWnxg0KO7Tlrm/xTru8+TkY2kOC8Ofr u85ETLw+7PQN0VOrRiwmdLBkGmNX1/hj1ztQEM33mhK0dc01MvfBgKSBTF38r6vO8GzP Qr3vUC/XJgZxqekI1KJK+BbRIkG2QGvMvULcFl3SWJ9syNVDgIyby9nmgAK/hCADDh+R RVQQ== X-Gm-Message-State: AOJu0YyRYyPymLaBsNPoexbDmnyspoW4QdkP8sawkEuSbh5TFe0N0szf nSI60aJZNh4t8JwPAyMw2h/j+Wo0cF/JbkdbMyzDPu+FstF39Q== X-Google-Smtp-Source: AGHT+IFKjrQX/ICqtR5BgXim/b5cWAMdUly++PqmsbpuMGG7MRThYVv7hI6cH8ONc52kQUeD3mK7JvbmW2v8ePjZTqM= X-Received: by 2002:a17:907:3fa4:b0:a23:671c:2284 with SMTP id hr36-20020a1709073fa400b00a23671c2284mr12742482ejc.29.1703692107285; Wed, 27 Dec 2023 07:48:27 -0800 (PST) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202312270608.3BR688vs024888@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Wed, 27 Dec 2023 08:48:16 -0700 Message-ID: Subject: Re: git: 6ac7c9f06ae9 - main - daemon: remove redundant parameter from listen_child() To: Alexey Dokuchaev Cc: Konstantin Belousov , Kyle Evans , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000dc94b3060d7fbad0" X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Spamd-Bar: ---- X-Rspamd-Queue-Id: 4T0bdm70yCz3Mbm --000000000000dc94b3060d7fbad0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Dec 27, 2023 at 8:31=E2=80=AFAM Alexey Dokuchaev wrote: > On Wed, Dec 27, 2023 at 04:49:20PM +0200, Konstantin Belousov wrote: > > On Wed, Dec 27, 2023 at 06:08:08AM +0000, Kyle Evans wrote: > > > commit 6ac7c9f06ae9b7ef070c1f8a57dcc52be4dd45b7 > > > > > > daemon: remove redundant parameter from listen_child() > > > > > > state already contains pipe fd > > > ... > > > @@ -448,9 +448,7 @@ daemon_eventloop(struct daemon_state *state) > > > /* child is dead, read all until > EOF */ > > > state->pid =3D -1; > > > state->mode =3D MODE_NOCHILD; > > > - while > (listen_child(state->pipe_fd[0], > > > - state)) > > > - ; > > > + while (listen_child(state)); > > > > This line is the style regression. > > We've seen this before and I reckon these regressions would keep happenin= g > when semicolon is put on the new line by itself alone. This would be les= s > likely to happen and makes the intention more obvious to say ``continue;'= '. > fwiw, that was the recommendation of the 'old unix hands' on USENET in the mid 80s. It made the intention clear. I was told, but never encountered, that some linting tools will warn about the above style but not while (foo) continue; and so that's been my personal style ever since. I've debugged lots of code that used this style, and it's a bugger to sort out if the indentation is correct and the ; is intended at the end of the line, or if it was intended... Warner --000000000000dc94b3060d7fbad0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Wed, Dec 27, 2023 at 8:31=E2=80=AF= AM Alexey Dokuchaev <danfe@freebsd.= org> wrote:
On Wed, Dec 27, 2023 at 04:49:20PM +0200, Konstantin Belousov wrote:
> On Wed, Dec 27, 2023 at 06:08:08AM +0000, Kyle Evans wrote:
> > commit 6ac7c9f06ae9b7ef070c1f8a57dcc52be4dd45b7
> >
> >=C2=A0 =C2=A0daemon: remove redundant parameter from listen_child(= )
> >
> >=C2=A0 =C2=A0state already contains pipe fd
> > ...
> > @@ -448,9 +448,7 @@ daemon_eventloop(struct daemon_state *state)<= br> > >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* child = is dead, read all until EOF */
> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0state->= ;pid =3D -1;
> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0state->= ;mode =3D MODE_NOCHILD;
> > -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0while (listen= _child(state->pipe_fd[0],
> > -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0state))
> > -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0;
> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0while (listen= _child(state));
>
> This line is the style regression.

We've seen this before and I reckon these regressions would keep happen= ing
when semicolon is put on the new line by itself alone.=C2=A0 This would be = less
likely to happen and makes the intention more obvious to say ``continue;= 9;'.

fwiw, that was the recommendat= ion of the 'old unix hands' on USENET
in the mid 80s.=C2= =A0 It made the intention clear. I was told, but never encountered,
that some linting tools will warn about the above style but not while (f= oo) continue;
and so that's been my personal style ever since= . I've debugged lots of code that
used this style, and it'= ;s a bugger to sort out if the indentation is correct and the ;
i= s intended at the end of the line, or if it was intended...

<= /div>
Warner
--000000000000dc94b3060d7fbad0--