From nobody Sun May 19 00:17:16 2024 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 153796504174247.35334135845346; Wed, 26 Sep 2018 05:30:41 -0700 (PDT) Received: from localhost ([::1]:58659 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g58xj-0005yx-76 for importer@patchew.org; Wed, 26 Sep 2018 08:30:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51860) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g58wl-0005d0-6a for qemu-devel@nongnu.org; Wed, 26 Sep 2018 08:29:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g58wi-00048U-2R for qemu-devel@nongnu.org; Wed, 26 Sep 2018 08:29:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58230) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g58wh-00048I-T0 for qemu-devel@nongnu.org; Wed, 26 Sep 2018 08:29:36 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0B2F4307D847 for ; Wed, 26 Sep 2018 12:29:35 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-98.ams2.redhat.com [10.36.116.98]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C99E32010CAB; Wed, 26 Sep 2018 12:29:34 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 0EC3D11385F2; Wed, 26 Sep 2018 14:29:33 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 26 Sep 2018 14:29:33 +0200 Message-Id: <20180926122933.3858-1-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.25 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Wed, 26 Sep 2018 12:29:35 +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] [PATCH] 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: , Cc: lvivier@redhat.com, pbonzini@redhat.com, thuth@redhat.com 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 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