From nobody Fri Nov 7 11:36:39 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1539152222357518.1316506809873; Tue, 9 Oct 2018 23:17:02 -0700 (PDT) Received: from localhost ([::1]:54992 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gA7np-0005Ux-Dj for importer@patchew.org; Wed, 10 Oct 2018 02:17:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34529) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gA7iY-00027o-LP for qemu-devel@nongnu.org; Wed, 10 Oct 2018 02:11:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gA7iV-0008FG-VY for qemu-devel@nongnu.org; Wed, 10 Oct 2018 02:11:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33712) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gA7iV-0007dZ-Mq for qemu-devel@nongnu.org; Wed, 10 Oct 2018 02:11:31 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 82688127AD for ; Wed, 10 Oct 2018 06:11:15 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-50.ams2.redhat.com [10.36.116.50]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E30AF77DD8 for ; Wed, 10 Oct 2018 06:11:14 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 488421132D83; Wed, 10 Oct 2018 08:11:13 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 10 Oct 2018 08:11:12 +0200 Message-Id: <20181010061113.6057-5-armbru@redhat.com> In-Reply-To: <20181010061113.6057-1-armbru@redhat.com> References: <20181010061113.6057-1-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 10 Oct 2018 06:11:15 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 4/5] libqtest: Inline g_assert_no_errno() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Macro g_assert_no_errno() intrudes into GLib's namespace. It's also pretty pointless. Inline. At one call site, its redundancy is now obvious. Delete it there. Signed-off-by: Markus Armbruster Message-Id: <20180926122933.3858-1-armbru@redhat.com> Reviewed-by: Laurent Vivier Reviewed-by: Thomas Huth --- tests/libqtest.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/tests/libqtest.c b/tests/libqtest.c index 2cd5736642..44ce118cfc 100644 --- a/tests/libqtest.c +++ b/tests/libqtest.c @@ -48,10 +48,6 @@ struct QTestState static GHookList abrt_hooks; static struct sigaction sigact_old; =20 -#define g_assert_no_errno(ret) do { \ - g_assert_cmpint(ret, !=3D, -1); \ -} while (0) - static int qtest_query_target_endianness(QTestState *s); =20 static int init_socket(const char *socket_path) @@ -61,7 +57,7 @@ static int init_socket(const char *socket_path) int ret; =20 sock =3D socket(PF_UNIX, SOCK_STREAM, 0); - g_assert_no_errno(sock); + g_assert_cmpint(sock, !=3D, -1); =20 addr.sun_family =3D AF_UNIX; snprintf(addr.sun_path, sizeof(addr.sun_path), "%s", socket_path); @@ -70,9 +66,9 @@ static int init_socket(const char *socket_path) do { ret =3D bind(sock, (struct sockaddr *)&addr, sizeof(addr)); } while (ret =3D=3D -1 && errno =3D=3D EINTR); - g_assert_no_errno(ret); + g_assert_cmpint(ret, !=3D, -1); ret =3D listen(sock, 1); - g_assert_no_errno(ret); + g_assert_cmpint(ret, !=3D, -1); =20 return sock; } @@ -325,7 +321,6 @@ static void socket_send(int fd, const char *buf, size_t= size) continue; } =20 - g_assert_no_errno(len); g_assert_cmpint(len, >, 0); =20 offset +=3D len; --=20 2.17.1