From patchwork Sun May 19 20:19:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 164485 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp4773040ili; Sun, 19 May 2019 13:30:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqxobh0rIv1FePr9I6qNKapVMhebZq9A9xF900hqCuUywb/apcJhk7kb7hbuob9snzpykSI/ X-Received: by 2002:a17:906:7e57:: with SMTP id z23mr24652862ejr.62.1558297811667; Sun, 19 May 2019 13:30:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558297811; cv=none; d=google.com; s=arc-20160816; b=n36H3KesrPqUobe1hZ+vEkI3J0MLdvNS+tdZJsStvutfko4OajKrQp9MgoXTOX5cIH q6j/jSkrsGxupAgM2lOaaSSjwkCrn1mg0ICLZ0cD4diJjUMgLiaUlJ5JHjlnLZfGMtOZ LSSAp0q/UJANTTWpffyDaWCGW4UqNxjvBs4TRAWNDlBRlU/9x05QauZoU0edNSTjPUzk TaUtvjj6TtOfCwr0Xmc2U6Q81z9Wp+duPGK/GqQe6klo8bwd0mD2o7HBeAKU+NkDQVL4 03Ycyg/d4mKm5s1jy0fSzU5iZgqmTlh/tKk2hDLSaZb5hygqAtZLqSK1LyTgfbAExvUd pmNQ== 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:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=IbY6I9DzAmMV/VMKU0boKo5CQjvFhhAqBWPLdeOiiQg=; b=NcqG5YnYQjpq+wQkeS6E69wUxgKzUVomyvz4GfJci35HIpj1IGeSkeY+QHhqZ6t82r 69fUk/4RPQ29tVByNI0W0Wm0YdYtN9itFLe5zrTDjI0b7nbrmV+nrmYkN5tulCQUdUtr LP/BPgmbmQFQm62Enb8/P2ZqqZInLSCHMgWouvcuRcJfIw3E1ghGk1z0zusUkV7ayfb+ zbbdb4YH1lKTyHJ1rygvYQiYR7Oi5auHjWj2BRYidgVTmO215zAB4CF51XYn3RAUNfZ3 zYAZBoHebmJ6+qjHqGa77GbeCv6eu936N8u+z3SlUkZ05wUcdU8qeA8KUML83QtOLkeM IoZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=tEbvvc7t; 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"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w14si1394345eda.226.2019.05.19.13.30.11 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 19 May 2019 13:30:11 -0700 (PDT) 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; dkim=fail header.i=@linaro.org header.s=google header.b=tEbvvc7t; 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"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:52983 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSSRe-0005W2-J3 for patch@linaro.org; Sun, 19 May 2019 16:30:10 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46800) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSSI2-0005kB-FB for qemu-devel@nongnu.org; Sun, 19 May 2019 16:20:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hSSI1-0007gX-77 for qemu-devel@nongnu.org; Sun, 19 May 2019 16:20:14 -0400 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:45335) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hSSHy-0007Yi-TD for qemu-devel@nongnu.org; Sun, 19 May 2019 16:20:12 -0400 Received: by mail-pf1-x441.google.com with SMTP id s11so6138582pfm.12 for ; Sun, 19 May 2019 13:20:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=IbY6I9DzAmMV/VMKU0boKo5CQjvFhhAqBWPLdeOiiQg=; b=tEbvvc7t1WACcnjP/5ylyqvnQoRBTCzCRHsXBCK4TES4dQkIQcGYyu7qbaF4/F8uDb GEaZCNUUcDsHpV83mTzUaWlektLdYY3Ip8WBvahvVH427Nbxd3Byg6D1EX2eF4JyT8R/ iOFhN48bZQNbT1f5jVc/3J+xeYBfs2ru0h4thwxI5NeYw5o7TWfg/dZoVDJ95kEODmbR Uo5BLpHe2ADscRrU9Pd0kyhO22TNvtTVJNo7yoznF07C7nKr+YQMIFDDP4SGuiI/w156 lhsE6mdaiCkWJCIWoypQHiYx1KNiY39SM68ZLyIbx5jVG0DiH7FORxHOnsUwzf2wO+fw hIRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=IbY6I9DzAmMV/VMKU0boKo5CQjvFhhAqBWPLdeOiiQg=; b=lU3xUnquejtW52I7uwPuPiRW5ij2R3RRHPsE9UogYdnFoOym+ZIeJw+4g3LZhiZZb+ HgbvbJ7la6plswzqgb6yH8ozBc873IeEUmbqtu5G3tigXZZ8Fh5uuSAK+FAgaGoLVxFN 1dsgnAStPuLXonIEPvNCYGLpkTT1W8moAAjzkLt4nrLyMn+U1NjwjdpnpUuiqYwURv5j wCDPdvGmwa903+sIiyGn/L/IEMciafg9qUb+fB4B2HLCzphPnXnuZEi1EtmZCUEp0+A0 LTQnievTAnkVi2t7siI/69L6z7EEhVzgns4TDs8nI93g8JpSeMALY2aye4V5ZBxRKMhg wWfQ== X-Gm-Message-State: APjAAAU5N8yZWAOBH/1M8phm9mVwhL37EiSROVfEImXMxleDRxIOukAc CLJ0I3lXfWvJrvd+iHIMrFLD/JBG7sQ= X-Received: by 2002:a63:700b:: with SMTP id l11mr15541010pgc.449.1558297209546; Sun, 19 May 2019 13:20:09 -0700 (PDT) Received: from localhost.localdomain (97-113-13-231.tukw.qwest.net. [97.113.13.231]) by smtp.gmail.com with ESMTPSA id e14sm18166264pff.60.2019.05.19.13.20.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 May 2019 13:20:08 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sun, 19 May 2019 13:19:51 -0700 Message-Id: <20190519201953.20161-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190519201953.20161-1-richard.henderson@linaro.org> References: <20190519201953.20161-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::441 Subject: [Qemu-devel] [PATCH 11/13] tests/tcg/multiarch/linux-test: Fix error check for shmat 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: laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The error indicator for this syscall is -1, not 0. Signed-off-by: Richard Henderson --- tests/tcg/multiarch/linux-test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.17.1 Reviewed-by: Laurent Vivier diff --git a/tests/tcg/multiarch/linux-test.c b/tests/tcg/multiarch/linux-test.c index fa4243fc04..673d7c8a1c 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);