From nobody Wed Jan 15 05:59:13 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1683309720; cv=none; d=zohomail.com; s=zohoarc; b=ia9thuFzx1u3fR2w6HtUYjqsaaTXTNaL5r97ojMSeVsAhSmWUBg5p+Gs+1AY4A8cdTqLhkppP8u8I86LNU3LqxxQU19/mA304beZvHa3S1BGw4El59+yefCbfT7sJv0/2864qgZnoxp9QFoBDpVUWYaA+i1SEGwG9zTb+qFGogk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683309720; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=0E0pG0RhLjYQKKbAYI1VpZMgXlwja3/EbGpIiIoj/9A=; b=N1yoncqpWOrka1VEZAU41a03ORTmkLVlRq6O1n59jIfVB6D/Xxlb6qvi7ojqrCGfj4oW453AHKkTZ8cAp/8SBlGu4qkbJqOgeA3hkB/ySci+5rXmc7G2vd2MKgqdXG9GpDojFqbCau5n7Oj8VU2h62TvrsYzVzyaGWjSU6uBg3Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1683309720621687.0640201890043; Fri, 5 May 2023 11:02:00 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-44-pd_e77x6P_CnDd6hohkkzA-1; Fri, 05 May 2023 14:01:54 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 884B218A646B; Fri, 5 May 2023 18:01:50 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 753C8492B01; Fri, 5 May 2023 18:01:50 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 542AA1946A48; Fri, 5 May 2023 18:01:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5DB311946A5E for ; Fri, 5 May 2023 18:01:49 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 3EB142026D25; Fri, 5 May 2023 18:01:49 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.45.224.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C14332026D16 for ; Fri, 5 May 2023 18:01:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683309717; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=0E0pG0RhLjYQKKbAYI1VpZMgXlwja3/EbGpIiIoj/9A=; b=R9Vjy3O27Qrr0skSkhsZ/JEMPBzfkVVReEixRdof3EArQyRviG7aKrsSFMPrTceDT4J1ap QgQNd/fztGZREoBL/32y26VU+pg5fhxMkxj97Y2JmJLVB//a9UBAeZXO099XaywjcbQBSW CAzzm9NpPPLmpDvPcZurN7QSQYfTjYY= X-MC-Unique: pd_e77x6P_CnDd6hohkkzA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 1/5] util: Small refactor Date: Fri, 5 May 2023 20:01:42 +0200 Message-Id: <20230505180146.551086-2-abologna@redhat.com> In-Reply-To: <20230505180146.551086-1-abologna@redhat.com> References: <20230505180146.551086-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1683309720964100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Prepare for further changes. Signed-off-by: Andrea Bolognani --- src/util/virfile.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/util/virfile.c b/src/util/virfile.c index 228482e8f8..8e94d19e45 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -1743,13 +1743,15 @@ virFindFileInPath(const char *file) return NULL; =20 path =3D g_find_program_in_path(file); - if (!path) - return NULL; =20 - /* Workaround for a bug in g_find_program_in_path() not returning abso= lute - * path as documented. TODO drop it once we require GLib >=3D 2.69.0 - */ - return g_canonicalize_filename(path, NULL); + if (path) { + /* Workaround for a bug in g_find_program_in_path() not returning = absolute + * path as documented. TODO drop it once we require GLib >=3D 2.69= .0 + */ + return g_canonicalize_filename(path, NULL); + } + + return NULL; } =20 =20 --=20 2.40.1