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: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 7774A1F5AE for ; Mon, 26 Apr 2021 20:12:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241851AbhDZUMw (ORCPT ); Mon, 26 Apr 2021 16:12:52 -0400 Received: from mail-ed1-f45.google.com ([209.85.208.45]:45874 "EHLO mail-ed1-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241741AbhDZUMw (ORCPT ); Mon, 26 Apr 2021 16:12:52 -0400 Received: by mail-ed1-f45.google.com with SMTP id d14so3418120edc.12 for ; Mon, 26 Apr 2021 13:12:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LUGLLxJyBH84XDSEkO15BXNhzRXfqDWw6c3W80oLQ74=; b=iL7atfIjEoXmuzanAqt9w8O84uaujpeXDDArJv8DIj8QwAu0Iob2zb5hlrEvGfuyH4 qFAmRwVw4x01dVKRCujbCCogQwwBDn0HDjRKWqBMaeJr4OZAK1Idf7c4IfZ3yFJJx3Pi m6tilac55aemCOL4Vfq+/7pkgyxMe5rzup0/gPBMUL8MR5PcUZDViW1mcv8fckORqeop MXAtixOI7oG8nooaAXvday0YVIeCJ97lE1wzo/EdIetpAJQOyIWcnJGjjJvWBQMR0j1E Ee9iM1vGNBxxyTTJVfw2mztDTivEy2A7IHRXvLDEdMDK2I9SnGL+gGoJKYs1QUZPKVxS z5Cw== X-Gm-Message-State: AOAM533ElQrGmb4w/oqHZqLTgq1kUos/Iw0ti3NoCnqY/KoOQq0dgM8n N/MSfvnP33PVZ0ZMQJekU5Y8xoQ+JBa6fZk0YlE= X-Google-Smtp-Source: ABdhPJwnJz7l8WFgQVQIBlixW0eR4ikG1YLAQvwXTwcPbn/y0chkAQ1SrZHXHUjUigCcDsoMqqy2lBQv2n+vGFNBWEA= X-Received: by 2002:aa7:c7cc:: with SMTP id o12mr431540eds.291.1619467929385; Mon, 26 Apr 2021 13:12:09 -0700 (PDT) MIME-Version: 1.0 References: <451563314d84f9d6dee29a4899b5d18033aa227d.1617291666.git.gitgitgadget@gmail.com> In-Reply-To: From: Eric Sunshine Date: Mon, 26 Apr 2021 16:11:58 -0400 Message-ID: Subject: Re: [PATCH 10/23] fsmonitor--daemon: add pathname classification To: Derrick Stolee Cc: Jeff Hostetler via GitGitGadget , Git List , Jeff Hostetler Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Mon, Apr 26, 2021 at 3:17 PM Derrick Stolee wrote: > On 4/1/2021 11:40 AM, Jeff Hostetler via GitGitGadget wrote: > > +#define FSMONITOR_COOKIE_PREFIX ".fsmonitor-daemon-" > > + > > + if (!fspathncmp(rel, FSMONITOR_COOKIE_PREFIX, > > + strlen(FSMONITOR_COOKIE_PREFIX))) > > Seems like this strlen() could be abstracted out. Is it > something the compiler can compute and set for us? Or, > should we create a macro for this constant? If you're asking whether the compiler will resolve strlen("literal string") to an integer constant at compile time rather than computing the length at runtime, then the answer is that on this project we presume that the compiler is smart enough to do that. Or are you asking for a function something like this? fspathhasprefix(rel, FSMONITOR_COOKIE_PREFIX)