From nobody Wed Dec 27 15:48:16 2023 X-Original-To: dev-commits-src-all@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 4T0bdn43HNz55rHW for ; Wed, 27 Dec 2023 15:48:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) (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 4T0bdn12JNz3MgM for ; Wed, 27 Dec 2023 15:48:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-552d39ac3ccso11034988a12.0 for ; Wed, 27 Dec 2023 07:48:29 -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=k1kzueMhZN04Tnbmw0gWOulP3bu2qn9x0TqO1ugbjz49zkUEt5VCi+pRpX5JcBpqX4 AotOMF589U/T6x0np7m/LuukrHRkci9dhmAX24v7Jo4AMIHVDzmrCNvyK+olDbZTBg4H 6tl2FhxpOanvDDaQgOA7y2S4eWfl/KL+TUz+DLllVglAMEJmnkYeCRhAD9WH/yRl67d9 4TPVy6N0g33Y1ft46oATCDXDuGzztlIgGNk+KyKjH6CeDGKhb8D5s/6UfknFBb9aUm0r ftEf666WyUSzC6L8dWtmCNUiLzhcIdw8wXxgPcOgWTyhJTjAXe3xaivXbm6WMqRjJpg5 KzyQ== X-Gm-Message-State: AOJu0Yyu6Q8pNQjYXfJUo17OplqHsIY/eHFgFb50wW8p4Jzi9ZA1f7Rt IlQY8ymwXuTA/nQEErnqezAORI723xx0LAPGe999mGWYHXw0mw== 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 all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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: 4T0bdn12JNz3MgM --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--