Re: [PATCH 19/23] fsm-health-win32: force shutdown daemon if worktree root moves
- From
Derrick Stolee <derrickstolee@github.com>
- Date
- Feb 24, 2022, 16:09 UTC
- Message-ID
- <c0d69427-aee1-7341-5b5f-1fe44ee0542d@github.com>
- In-Reply-To
- <023fcd6e2b1163ab3d23b0d5933c14586d814ce0.1644940774.git.gitgitgadget@gmail.com>
On 2/15/2022 10:59 AM, Jeff Hostetler via GitGitGadget wrote:
Show 15 quoted lines
> From: Jeff Hostetler <jeffhost@microsoft.com>
> diff --git a/compat/fsmonitor/fsm-health-win32.c b/compat/fsmonitor/fsm-health-win32.c
> index 3c3453369cd..2526ad9194f 100644
> --- a/compat/fsmonitor/fsm-health-win32.c
> +++ b/compat/fsmonitor/fsm-health-win32.c
> @@ -14,7 +14,10 @@ enum interval_fn_ctx { CTX_INIT = 0, CTX_TERM, CTX_TIMER };
> typedef int (interval_fn)(struct fsmonitor_daemon_state *state,
> enum interval_fn_ctx ctx);
>
> +static interval_fn has_worktree_moved;
> +
> static interval_fn *table[] = {
> + has_worktree_moved,
> NULL, /* must be last */
> };Looking at this now, I think table[] should be defined immediately before fsm_health__loop() so it is easier to see how they interact. It also avoids this static declaration of the function before its implementation.
Or, is there a reason it is so high up in the file?
Thanks, -Stolee