From patchwork Mon Jul 9 01:49:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 141356 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2115819ljj; Sun, 8 Jul 2018 18:51:24 -0700 (PDT) X-Google-Smtp-Source: AAOMgpezg0PnPuGi6HyFj3ZT+BO+3WTVOU6q+ReD5IdJx9rJIVnGPv1dMab0aSZk0Z3ECFhpviJp X-Received: by 2002:a37:f86:: with SMTP id 6-v6mr15754246qkp.48.1531101084118; Sun, 08 Jul 2018 18:51:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531101084; cv=none; d=google.com; s=arc-20160816; b=U9sjkpsP0d271VhxUK87dyeGq9jTSnf0osSAomOFFFus9yY2EXwGnGtacRtVAxyvSd 0I/FrZc7CPgfALbI68cjCIKXrVODpLh+EDvRmVmEdT2OmZghoUOl2yZRIgw+Go2Pqoox 8lvro2nVi3Lss50T07vGKN7pZIdrNaVBwokGCZzVpfEGTZv2O02CuKOmzbwxTj1TW0Fl ZXjZmhjNdPeJhBEqV1mc8A2IF3w1tl0LdnjVRtqo0CgHTNJl9qw6A38IFBOINtdChVFs N3INuTPvUaV/n/R/okLNGVEY+wOkZpuXLGTTZyfw1CtnECNtdj5ah/Ykh9Xu/agOF7fn +a/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:message-id:date:to:from :dkim-signature:arc-authentication-results; bh=szYqaav/NNMceNmIIJTLRwm7YWtwQ4ia65RQK6EI7m4=; b=mp0WA233fBbaI9Bzzgo1tg4lZzYJmsaqMZsEhLrXtS2kWNJKrFKfYuZicXXTM6yANK h91UgPD8acbBLvLtxA6arWPU/0iXTh3WFGtLEKk1W+w/e6yqknfOxOSyKLd9bC9wia0r SnY8tSgSl6QuiTcVMB+qehmfYDG767mjNaJwi9r0QS81JD5q5Oy29mSZyLWhtXEr+Wlj 03hQElBJi536fP7YfE50GzPniOcK8G12X/zhzussLLPb4CY2dtWPrPhZ+mKcM5sVUc/M mM30jI7Vm0abViyNDoOlf13bdKRwm5nPrfa7zrl/KqmHqgKOHU0JqM6JHOLX0tVOG1zm CrhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Z6NI76zz; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id u187-v6si4678777qkd.356.2018.07.08.18.51.23 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 08 Jul 2018 18:51:24 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Z6NI76zz; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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 ([::1]:38879 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcLKl-00084k-Gm for patch@linaro.org; Sun, 08 Jul 2018 21:51:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50973) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcLJR-0007gU-Oi for qemu-devel@nongnu.org; Sun, 08 Jul 2018 21:50:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fcLJN-0005Az-HX for qemu-devel@nongnu.org; Sun, 08 Jul 2018 21:50:01 -0400 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:37379) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fcLJN-00059H-A0 for qemu-devel@nongnu.org; Sun, 08 Jul 2018 21:49:57 -0400 Received: by mail-pg1-x544.google.com with SMTP id n15-v6so924719pgv.4 for ; Sun, 08 Jul 2018 18:49:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id; bh=szYqaav/NNMceNmIIJTLRwm7YWtwQ4ia65RQK6EI7m4=; b=Z6NI76zzMlJ7ypWhaRjyfWQjvt3HOQcFDOSKNjojLQCjUOxlTvDeuHphKY2AtDRqHu F9q1Qmo7AwteHl/6UiIlUEPc3TMNmXmuBJaQI+FCUwZO/tU6EcKCPNDCnWMNKQ647KbN MV6XibPqMjIhaRpYlckDT/bnMmeqAIpyFWV+g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=szYqaav/NNMceNmIIJTLRwm7YWtwQ4ia65RQK6EI7m4=; b=Hx/yg6I63fn6O9qB9zdr+Ah6E+YWJMiIxAQ7K+J89SKUboA/2IV9YeqnIhttmM3lJm scps3ck+F5wnIfAORwweEllMSXXYHchsji5HA6hJXpkxoVo3bP9VR5XFJJ6gf50YmFhS +yPHrh7VYGgiA5Ql/+ofwoA3IwBkImmzF96J+xNQ7kUpMdRMzJe+FabBDQj1dB+9/85n zAdBpXC2lY+Ub8cYYjPt2CJ24zyfUx6cmKgL7eA92uYxSrA5A1tpiVvZw3Oqxbvyg4zN f47AwWc/4tTTO89P+Vd66ErJSdQiWKTyONL//A+29fVqMCRrpq+tzSLvoibqZ7BWhtOc EGcg== X-Gm-Message-State: APt69E1VVKmRJeOvyezTuIY52PqXVSKN2Ji5Gq+Kg3qrkKYTJe2D1MH9 HU3uywBX6pkg13c9PZigkqj4RleaweU= X-Received: by 2002:a63:5c7:: with SMTP id 190-v6mr16793719pgf.385.1531100995403; Sun, 08 Jul 2018 18:49:55 -0700 (PDT) Received: from cloudburst.twiddle.net (97-126-112-211.tukw.qwest.net. [97.126.112.211]) by smtp.gmail.com with ESMTPSA id i17-v6sm26399965pfj.95.2018.07.08.18.49.54 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 08 Jul 2018 18:49:54 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sun, 8 Jul 2018 18:49:53 -0700 Message-Id: <20180709014953.26230-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::544 Subject: [Qemu-devel] [PATCH] 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: , 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: Emilio G. Cota diff --git a/tests/tcg/multiarch/linux-test.c b/tests/tcg/multiarch/linux-test.c index e80eccc0ce..6d2c02c5c0 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);