From nobody Sun May 5 13:57:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1566293039; cv=none; d=zoho.com; s=zohoarc; b=f1j8oKgolCK4u4oSsPGf+QzBN0beFSlDspl5Aox8ZBcQrt4vy2Q3NctdqN5J2jlHvTHQ4NeI16MmF+w3Y0BoevSGl0g+p0nnTouHsKS2xpzv8esEDqepw981Np1l1O2ziHZ+VkN1yKDY09v9tJK1I7MpICjSb6t4RXxT6zz5Nas= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566293039; 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:ARC-Authentication-Results; bh=EvB3I6nigtQJ6wp6c+7pV05I98lIjTtxbUJT9ci0kOY=; b=nPD5NwIEr6gB1RNFo9pSVdrU4zy6GoAMYS4J4NlPbQJoevDxwmPKIjAO+NJJaJNW0ktp30bhLsj5N/FCyGsLh8h2C0YMsUgNv9e+PX3ny9n+Q8tho80sEaJEbRCwd4sCXGa8GzQx1v5XJ7O/VKDcoaK2LisutjzSMm4jUjYGdZs= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566293039246447.9839683323328; Tue, 20 Aug 2019 02:23:59 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9FE19302C06D; Tue, 20 Aug 2019 09:23:57 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 59DC67B6CB; Tue, 20 Aug 2019 09:23:57 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8677618005B9; Tue, 20 Aug 2019 09:23:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7K9NtGm015288 for ; Tue, 20 Aug 2019 05:23:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3D4FF3739; Tue, 20 Aug 2019 09:23:55 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-61.ams2.redhat.com [10.36.112.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 64AA339C1; Tue, 20 Aug 2019 09:23:49 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Tue, 20 Aug 2019 10:23:48 +0100 Message-Id: <20190820092348.14863-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] tests: don't try to mock __open_2 on non-GLibc builds X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Tue, 20 Aug 2019 09:23:58 +0000 (UTC) Mocking of the __open_2 function was added in commit 459f071cacf30af9df93b7d090b1bda71b0ef20f Author: Michal Privoznik Date: Thu Aug 15 16:37:17 2019 +0200 virpcimock: Mock __open_2() This function only exists in glibc, however, and the mocking code runs on systems not using glibc, such as FreeBSD. Even Linux hosts might be using a different libc impl, though we don't actively try to support that. Signed-off-by: Daniel P. Berrang=C3=A9 --- Pushed as a CI build fix for FreeBSD tests/virpcimock.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/virpcimock.c b/tests/virpcimock.c index ca6cc060fd..e9a3791aea 100644 --- a/tests/virpcimock.c +++ b/tests/virpcimock.c @@ -32,7 +32,9 @@ =20 static int (*real_access)(const char *path, int mode); static int (*real_open)(const char *path, int flags, ...); +#ifdef __GLIBC__ static int (*real___open_2)(const char *path, int flags); +#endif /* ! __GLIBC__ */ static int (*real_close)(int fd); static DIR * (*real_opendir)(const char *name); static char *(*real_virFileCanonicalizePath)(const char *path); @@ -955,7 +957,9 @@ init_syms(void) =20 VIR_MOCK_REAL_INIT(access); VIR_MOCK_REAL_INIT(open); +#ifdef __GLIBC__ VIR_MOCK_REAL_INIT(__open_2); +#endif /* ! __GLIBC__ */ VIR_MOCK_REAL_INIT(close); VIR_MOCK_REAL_INIT(opendir); VIR_MOCK_REAL_INIT(virFileCanonicalizePath); @@ -1084,6 +1088,7 @@ open(const char *path, int flags, ...) } =20 =20 +#ifdef __GLIBC__ /* in some cases this function may not be present in headers, so we need * a declaration to silence the complier */ int @@ -1113,7 +1118,7 @@ __open_2(const char *path, int flags) =20 return ret; } - +#endif /* ! __GLIBC__ */ =20 DIR * opendir(const char *path) --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list