Re: [PATCH 19/23] fsm-health-win32: force shutdown daemon if worktree root moves
- From
- Jeff Hostetler <git@jeffhostetler.com>
- Date
- Mar 3, 2022, 18:00 UTC
- Message-ID
- <2812e2af-4a63-09ae-89c9-bab8fb487100@jeffhostetler.com>
- In-Reply-To
- <c0d69427-aee1-7341-5b5f-1fe44ee0542d@github.com>
On 2/24/22 11:09 AM, Derrick Stolee wrote:
Show 23 quoted lines
> On 2/15/2022 10:59 AM, Jeff Hostetler via GitGitGadget wrote:
>> 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?I don't think so. I was trying to keep all of the public API routines at the bottom, but all of the static stuff is pretty much free to move around.
I'll revisit.
Thanks Jeff