From nobody Tue May 14 13:54:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1648482609; cv=none; d=zohomail.com; s=zohoarc; b=VbfXltQuOsmP0D51DNbjpOYdI3/oiKvQ/bJWbZiWLXEFTP9AWKIQGULLeUNLKa+2YvSz6o5xs5I68CkYX5aEUyDjU4zmAqttZQ4C2YvU0DORO0+bDJxALpsK9zOwdCL4BCJzai+go3HyMQs2uUEvHm9jdoIHDxjIXWvIylq3UkE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1648482609; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=vhWhejpKqbb8kX3n9OhmWkPi7hpX7ZKghDq1YMsjNoE=; b=PyV9TA6BPaUg/YFfcIJKR1GqJ/gzUTRLAnP6XHcHpBIKb30d4/BmNfceFFkM7vxXYx1IxW3k7Yu4a4NrA0yW4NbeDLCemD/xHseq96sd068J/MrYI82/XF3CN7yeRuG3Ys4acFdFIJHdW8sS1bLVjSgk8gSX0JwGWOvV+3g1aD0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1648482609493545.3240338877658; Mon, 28 Mar 2022 08:50:09 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-399-FVoNXldZNBuKF-svxve0mA-1; Mon, 28 Mar 2022 11:50:06 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 86F243C1EA43; Mon, 28 Mar 2022 15:50:03 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 42C3940CF8FD; Mon, 28 Mar 2022 15:50:01 +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 256581947BBF; Mon, 28 Mar 2022 15:50:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id AA4741947BBE for ; Mon, 28 Mar 2022 15:49:59 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 94BBC40CF8FF; Mon, 28 Mar 2022 15:49:59 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.195.87]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2431A40CF8E8 for ; Mon, 28 Mar 2022 15:49:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648482608; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=vhWhejpKqbb8kX3n9OhmWkPi7hpX7ZKghDq1YMsjNoE=; b=ZgM3bmlgve3wcUHHlU/CCEoi1angmlOIEvs2OIjjoTL6neU9KzAK6VLfGBFlqjXrBGIIxW 4VQq17z2XjFbL/TGw735IijDylV37IByoot4A9B0ZwJI+2kZzSWMAoITkIeyahmBgDOe0L Cjz/pbC0Qace9dZTjNhj1GvK8vOCDJ0= X-MC-Unique: FVoNXldZNBuKF-svxve0mA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH] util: Improve macOS workaround Date: Mon, 28 Mar 2022 17:49:57 +0200 Message-Id: <20220328154957.378129-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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 2.84 on 10.11.54.1 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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: 1648482611557100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Since the workaround is specific to macOS, only disable compiler warnings when building on that platform. While at it, update the comment to reflect the fact that the workaround is needed for all versions of the OS, including the modern ones that we currently target. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- Test pipeline: https://gitlab.com/abologna/libvirt/-/pipelines/502990271 src/util/virutil.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/util/virutil.c b/src/util/virutil.c index fe5500726e..176e2f8f59 100644 --- a/src/util/virutil.c +++ b/src/util/virutil.c @@ -869,9 +869,11 @@ virDoesGroupExist(const char *name) =20 =20 =20 -/* Work around an incompatibility of OS X 10.11: getgrouplist +/* Work around an incompatibility of macOS: getgrouplist accepts int *, not gid_t *, and int and gid_t differ in sign. */ +# ifdef __APPLE__ VIR_WARNINGS_NO_POINTER_SIGN +# endif =20 /* Compute the list of primary and supplementary groups associated * with @uid, and including @gid in the list (unless it is -1), @@ -934,7 +936,9 @@ virGetGroupList(uid_t uid, gid_t gid, gid_t **list) return ret; } =20 +# ifdef __APPLE__ VIR_WARNINGS_RESET +# endif =20 =20 /* Set the real and effective uid and gid to the given values, as well --=20 2.35.1