From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 299C3C04FF3 for ; Mon, 24 May 2021 19:13:35 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 907CA61414 for ; Mon, 24 May 2021 19:13:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 907CA61414 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:53088 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llG17-0006Tx-Gw for qemu-devel@archiver.kernel.org; Mon, 24 May 2021 15:13:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49586) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llG0T-0005ji-Lo for qemu-devel@nongnu.org; Mon, 24 May 2021 15:12:53 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]:43695) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llG0Q-0000wf-N5 for qemu-devel@nongnu.org; Mon, 24 May 2021 15:12:53 -0400 Received: by mail-pf1-x431.google.com with SMTP id d78so20767355pfd.10 for ; Mon, 24 May 2021 12:12:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=2VNuMHAjlFBNVczoGZhWv/Oncln75SFg6j/XUT6B9yE=; b=WkGaX+g51FXVVcpl6u9dDkS2o+0AMvgrkvEMXQhqUJ+xk3PiDtHJQ65CiXMM1gFBnZ hSekFM2W3BjWhxcu0oWlu8b428CwNVvDz4nhjeuZAZjZXGNfS2O39YNl1jUPYw5of0rF o4jGh87HFnGL0pZuwyWY4c+d0shUlVimgBjKj8PKR2XVJK2EVDZGUAuI5GdJ2bpTXKaY ftqbuDZ3TNEJlxiWAv1Qp5GL/pySuQkCHgOLkMC5mniPYVbI6sStDCsX2Hk6kdht32wA D5xPAl0opD58yy4AxkAdCwcaD55pyiDYHZtjdCLF8XjcW9ogzuANDbVY7OdXIB7rz696 PsBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=2VNuMHAjlFBNVczoGZhWv/Oncln75SFg6j/XUT6B9yE=; b=RR8vl5DyUOpBcw1Rr3214lur8cOy+w7ww2pdsrlYa8wO7zgkK0thGmRQOaAYhRzWrf odaNMO9deyeOm+0IK+D96jNZv4NJaSzT/BVdhXYOpVnwSAGTV3YtMzs8IwHYz1KIYmh4 UUn+VbG8l6ecAN9AivWkPMHY14srl+Hemmm8GazmfcMsCKKzo9/f0OsxaPmkQYtZPA6h /kryZYSFxnOSVgsABFg+LVTLcgEovIJ2ea9JLjGNKmADhnZwkiwbFFHgyX+rJWydQzJh pXdqCX8fn50le8Crx7gkBFap+F6v7bOXohv5bulOc5Apl0XqreXEyg2SG9VH96D/gigB dHgg== X-Gm-Message-State: AOAM531v4/3zdLRb4sMR0XPcNdxsZc07A+Se/dR21GOGgU3KYLk8P3Vs trfkWX4+TEKels6FsOPP3V7iKQ== X-Google-Smtp-Source: ABdhPJyuwEsLXKeiqMOFKbBh6nojkmPL79zA4M1XGDKKb8NT+o4xuPYzvUKYXwjeo+hgvFMhNc2JYA== X-Received: by 2002:aa7:982e:0:b029:2e4:eef5:e0c9 with SMTP id q14-20020aa7982e0000b02902e4eef5e0c9mr17686296pfl.3.1621883569118; Mon, 24 May 2021 12:12:49 -0700 (PDT) Received: from [192.168.1.11] (174-21-70-228.tukw.qwest.net. [174.21.70.228]) by smtp.gmail.com with ESMTPSA id e23sm11915571pfl.84.2021.05.24.12.12.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 May 2021 12:12:48 -0700 (PDT) Subject: Re: [RFC PATCH] linux-user: glib-ify is_proc_myself To: =?UTF-8?Q?Alex_Benn=c3=a9e?= , qemu-devel@nongnu.org References: <20210524112323.2310-1-alex.bennee@linaro.org> From: Richard Henderson Message-ID: Date: Mon, 24 May 2021 12:12:47 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210524112323.2310-1-alex.bennee@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , yamamoto@midokura.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 5/24/21 4:23 AM, Alex Bennée wrote: > + } else if (g_ascii_isdigit(*filename)) { > + g_autofree char * myself = g_strdup_printf("%d/", getpid()); > + if (!g_str_has_prefix(filename, myself)) { This seems roundabout. Wouldn't it be better to qemu_strtoul and compare the integers? r~