Date: Wed, 27 Dec 2023 10:11:10 -0600 From: Kyle Evans <kevans@FreeBSD.org> To: Warner Losh <imp@bsdimp.com>, Konstantin Belousov <kostikbel@gmail.com> Cc: Alexey Dokuchaev <danfe@freebsd.org>, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 6ac7c9f06ae9 - main - daemon: remove redundant parameter from listen_child() Message-ID: <6ac83dfe-bfeb-4135-9292-d7625d6da642@FreeBSD.org> In-Reply-To: <CANCZdfqhdx9mG2zogBQEz3%2BAGTrf7F7bConf-b4R40BjzH6MqA@mail.gmail.com> References: <202312270608.3BR688vs024888@gitrepo.freebsd.org> <ZYw5cGZAuLSbO8AW@kib.kiev.ua> <ZYxDXbj50bjYrxC0@FreeBSD.org> <CANCZdfqhdx9mG2zogBQEz3%2BAGTrf7F7bConf-b4R40BjzH6MqA@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 12/27/23 09:48, Warner Losh wrote: > > > On Wed, Dec 27, 2023 at 8:31 AM Alexey Dokuchaev <danfe@freebsd.org > <mailto: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 > > > > > > 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 = -1; > > > state->mode = 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 > happening > when semicolon is put on the new line by itself alone. This would > be less > 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 Both of these fixed in e064557916a905d0add20c4012cf3678131c11e7, thanks. I also like the more explicit form here.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6ac83dfe-bfeb-4135-9292-d7625d6da642>