From patchwork Wed Nov 6 13:04:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 178684 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp583493ilf; Wed, 6 Nov 2019 05:08:16 -0800 (PST) X-Google-Smtp-Source: APXvYqwiAmLL9fSFmuNsBGVwYMGYXzqROJ4QxptyXnJQ/X0CYDOmrs+I7I9XnJLqsdqa5TyHUIE2 X-Received: by 2002:a50:cd14:: with SMTP id z20mr2495066edi.226.1573045696608; Wed, 06 Nov 2019 05:08:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573045696; cv=none; d=google.com; s=arc-20160816; b=mheQ7e7aIMwebhBc+Xw1PwUvobupCf8TMbGqKGocxYnPp5xShW5ViNLeGTnQOsA7NL /QrJyEuaxl6fE9ZD4aRCeJMZ4Jp3BFQhPW3SaK1P999DVWRZkFi4vGz6AaeMoGbMvN3J izZQzRISq4fq5clbVWcw0qm6JkmEQMqXSTLeYnModbVj/BeaYxWMYST/N3aD5gu9sn6V v4dz/JNYtu/a0t5UQyiUwnXtv6C+i4PC5+474t/NuwAkNXowhRZZW+xRwDAPgLYvbgzd FWIxYvv2uPWCMniOm6riILBhPjFp1UKRtsk85GLM/YvT7j9HnprYSOkQOVUptPwszuQ8 Qr4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=Pft8K4rg6npcQqfz5dief5yIu3/lUG8QnT4Cfc+2QfM=; b=SWAhdVwZBL2HE5tn4Sl1mTKcVH5jij8yIqfiqVDLz3PGvL8Ly2KYLP5StN5wnbu1H3 4qOxlmfS4NcWQC1vMUb/ePpf++vzejng/ig0nJZmwINISeaSC5pIic8K3L2tJ5ovO3P7 IsKkk9Ikw4f++K48PTiXTjrjz22utsjdKJLZWeBt5LJbFBSm9a7EM7GHuJrr4/2w+Nqn BydiFnUoMMMGrkjT2d+XSCRaUNk2XdUL0KAd4Aag5o+JxeeVersdoTAXY5EcGveF0Cr+ iKKvLitOfltSGiepB7giH1Q5KXJHzjUENxp6zBikSCNzRw+50MhNTD1q/BiHjNfy+ayq f+Jg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y11si13436837edd.182.2019.11.06.05.08.16 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Nov 2019 05:08:16 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:57852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSL2l-00073x-2C for patch@linaro.org; Wed, 06 Nov 2019 08:08:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36449) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSKzt-0003S2-HD for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSKzs-0002wU-Dv for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:17 -0500 Received: from mout.kundenserver.de ([212.227.126.133]:43641) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iSKzs-0002vZ-4L for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:16 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N63NQ-1hqnLo2u8u-016Pwb; Wed, 06 Nov 2019 14:05:08 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL v2 03/13] tests/tcg/multiarch/linux-test: Fix error check for shmat Date: Wed, 6 Nov 2019 14:04:46 +0100 Message-Id: <20191106130456.6176-4-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191106130456.6176-1-laurent@vivier.eu> References: <20191106130456.6176-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:Vu1BYmduwVjJTm9simsfiMGEKoqN9w6waqLssuklMSO6JIBEGVU 9EeL0wEnC5U4DUjrnHPoocjRh3N4mKrdkynjbqqV7i3Orom2/BvPyfmOQ5vqCV3P/vG0jAx UDJJzkliQ2XEw7La3Ac0XAaAf5SeFxxLxG0PoageV1T/TwWa+zRAU1XBqtDcGcpekxcVVHZ IyTtU4J+13UVQsSKoRrvQ== X-UI-Out-Filterresults: notjunk:1; V03:K0:xROpSsYcRq8=:7mHkMJ+n9Ny8JVJpwk4VwW fsVRVxbvzqdQyPXu1WDM/B2zkWyGNbyjM53mr/x5lC2OImt0+tGEjqaNtagvXo4uoHn7xfyLB vNHOZU2jn7f45inIZdR4cHrRofVU+ZGioCjTbjcAEmeN5FD5O8/D4DKu54bNaYhgO6lD/I20k 880f7Sfs3zx/1tZWbBoy/yMuZlKpEFzFMDw5hqopomWFj7+TDPeWons4yva1Zf7Kf96BACA0P CXpxdUvmW5tTKHKhPKLkZKstEHTNjSF4eXX53SSsMO0MM59ylzCMdFdN8h5zNAxW1H2glTPL6 NJaJ8hdT6phqTnnCzw2NdTGzBUEgq4YI5aepBnU0Q9+W6XfZm8xkR6MJ5nAQ3OkVtIB4vnwj3 dqpz8fnV2SlCbevGx5xEdNkkixBWpgUQI+GaIDIk/JqwRyZA95GmtmAKwsGJ6WKMfAsioV4h+ wYM1gq2OBkOeROQIzuW0LV+ho+DIlQEb2D+EVJ9cvL7JczLrw3Kx0aAcgiDISDczFrl4zUI8b Q0V4XHBDiR1wPXlqXxmMDehl4iDi425yIC+FTDwOuoEHXtxAvDM2xDFH68gZuko+ZMusP27YH ATWt7ewG7sYwEVnmL1ncDrBl/Y2dsf7cuAX1PbeastECVVu6TXl79u+7fy+0c5QbHOM/UWcMX Gw1qWgUeNF7TVXzn/o3t622LaK4+B6ee5Z/09U8NxxaYHDD6PetDciDIhnUcDD1FBrF2+QJjS 7ekJ4oEQIlqRSAxRgoXgMKsDGPB8p6OzPr24zOsRlWIbkJJTAJol0k1hc0uo2k9fd9Y3orYTF rREHohLKSpyeI9ML7CJq2jM4iyb4mcDEue07EMewFoWFpQ7f4hjHQSEbt9ME2452PgQ+AYwRM ocMhAFrjy61HvbxUAIkA== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.133 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , Riku Voipio , Mark Cave-Ayland , Laurent Vivier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , Artyom Tarasenko Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson The error indicator for this syscall is -1, not 0. Fixes: e374bfa35bfb ("shm tests - disabled clone test") Reviewed-by: Laurent Vivier Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20191106113318.10226-3-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- tests/tcg/multiarch/linux-test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.21.0 diff --git a/tests/tcg/multiarch/linux-test.c b/tests/tcg/multiarch/linux-test.c index fa4243fc0426..673d7c8a1c25 100644 --- a/tests/tcg/multiarch/linux-test.c +++ b/tests/tcg/multiarch/linux-test.c @@ -503,8 +503,9 @@ static void test_shm(void) shmid = chk_error(shmget(IPC_PRIVATE, SHM_SIZE, IPC_CREAT | 0777)); ptr = shmat(shmid, NULL, 0); - if (!ptr) + if (ptr == (void *)-1) { error("shmat"); + } memset(ptr, 0, SHM_SIZE);