Re: git: 8935a3993219 - main - daemon: use kqueue for all events

From: Konstantin Belousov <kostikbel_at_gmail.com>
Date: Fri, 14 Apr 2023 07:43:19 UTC
On Fri, Apr 14, 2023 at 05:13:54AM +0000, Kyle Evans wrote:
> The branch main has been updated by kevans:
> 
> URL: https://cgit.FreeBSD.org/src/commit/?id=8935a3993219be76c7ea03e9ad4509657d08af6c
> 
> commit 8935a3993219be76c7ea03e9ad4509657d08af6c
> Author:     Ihor Antonov <ihor@antonovs.family>
> AuthorDate: 2023-04-14 05:10:29 +0000
> Commit:     Kyle Evans <kevans@FreeBSD.org>
> CommitDate: 2023-04-14 05:12:21 +0000
> 
>     daemon: use kqueue for all events
>     
>     Refactor daemon to use kqueue/kevent instead of signals.
>     
>     This changes allows to simplify the code in several ways:
>     - the execution flow is now linear, no async events.
>     - several variables became redundant and got removed.
>     - all event handling is now concentrated inside of the event loop, which
>       makes code reading and comprehension easier.
>     - new kqueuex(2) call is used for CLOEXEC, but maintained closing the
>       kq fd prior to execve() to ease later MFC

> +	/* Signals are processed via kqueue */
> +	signal(SIGHUP, SIG_IGN);
> +	signal(SIGTERM, SIG_IGN);
Are you sure that this works?  When a signal disposition is set to 'ignore',
the signal delivery drops the signal immediately without queuing/notifying
the victim.  I very much doubt that you would get any kqueue event for HUP
or TERM after the calls.