From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: * X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=1.4 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,LIST_MIRROR_RECEIVED,MAILING_LIST_MULTI, NICE_REPLY_A,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=no autolearn_force=no version=3.4.2 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id 3D9A01F670 for ; Thu, 3 Mar 2022 18:00:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235541AbiCCSA6 (ORCPT ); Thu, 3 Mar 2022 13:00:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229538AbiCCSA4 (ORCPT ); Thu, 3 Mar 2022 13:00:56 -0500 Received: from siwi.pair.com (siwi.pair.com [209.68.5.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70016194A95 for ; Thu, 3 Mar 2022 10:00:10 -0800 (PST) Received: from siwi.pair.com (localhost [127.0.0.1]) by siwi.pair.com (Postfix) with ESMTP id BC55A3F4A9E; Thu, 3 Mar 2022 13:00:09 -0500 (EST) Received: from jeffhost-mbp.local (162-238-212-202.lightspeed.rlghnc.sbcglobal.net [162.238.212.202]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by siwi.pair.com (Postfix) with ESMTPSA id 905563F4A9D; Thu, 3 Mar 2022 13:00:09 -0500 (EST) Subject: Re: [PATCH 19/23] fsm-health-win32: force shutdown daemon if worktree root moves To: Derrick Stolee , Jeff Hostetler via GitGitGadget , git@vger.kernel.org Cc: Jeff Hostetler References: <023fcd6e2b1163ab3d23b0d5933c14586d814ce0.1644940774.git.gitgitgadget@gmail.com> From: Jeff Hostetler Message-ID: <2812e2af-4a63-09ae-89c9-bab8fb487100@jeffhostetler.com> Date: Thu, 3 Mar 2022 13:00:08 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On 2/24/22 11:09 AM, Derrick Stolee wrote: > On 2/15/2022 10:59 AM, Jeff Hostetler via GitGitGadget wrote: >> From: Jeff Hostetler >> 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