All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: laurent@vivier.eu
Subject: [PATCH v3 02/12] tests/tcg/multiarch/linux-test: Fix error check for shmat
Date: Wed,  6 Nov 2019 12:33:08 +0100	[thread overview]
Message-ID: <20191106113318.10226-3-richard.henderson@linaro.org> (raw)
In-Reply-To: <20191106113318.10226-1-richard.henderson@linaro.org>

The error indicator for this syscall is -1, not 0.

Fixes: e374bfa35bfb ("shm tests - disabled clone test")
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20191025113921.9412-3-richard.henderson@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 tests/tcg/multiarch/linux-test.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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);
 
-- 
2.17.1



  parent reply	other threads:[~2019-11-06 11:35 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-06 11:33 [PATCH v3 00/12] linux-user sparc fixes Richard Henderson
2019-11-06 11:33 ` [PATCH v3 01/12] scripts/qemu-binfmt-conf: Update for sparc64 Richard Henderson
2019-11-06 11:33 ` Richard Henderson [this message]
2019-11-06 11:33 ` [PATCH v3 03/12] target/sparc: Define an enumeration for accessing env->regwptr Richard Henderson
2019-11-06 11:33 ` [PATCH v3 04/12] linux-user/sparc: Use WREG constants in sparc/target_cpu.h Richard Henderson
2019-11-06 11:33 ` [PATCH v3 05/12] linux-user/sparc: Begin using WREG constants in sparc/signal.c Richard Henderson
2019-11-06 11:33 ` [PATCH v3 06/12] linux-user/sparc: Use WREG_SP constant " Richard Henderson
2019-11-06 11:33 ` [PATCH v3 07/12] linux-user/sparc: Fix WREG usage in setup_frame Richard Henderson
2019-11-06 11:33 ` [PATCH v3 08/12] linux-user/sparc64: Fix target_signal_frame Richard Henderson
2019-11-06 11:33 ` [PATCH v3 09/12] linux-user: Rename cpu_clone_regs to cpu_clone_regs_child Richard Henderson
2019-11-06 11:33 ` [PATCH v3 10/12] linux-user: Introduce cpu_clone_regs_parent Richard Henderson
2019-11-06 11:33 ` [PATCH v3 11/12] linux-user/sparc: Fix cpu_clone_regs_* Richard Henderson
2019-11-06 11:33 ` [PATCH v3 12/12] linux-user/alpha: Set r20 secondary return value Richard Henderson
2019-11-06 14:45 ` [PATCH v3 00/12] linux-user sparc fixes Laurent Vivier
2019-11-06 14:58 ` no-reply
2019-11-06 15:43   ` Laurent Vivier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191106113318.10226-3-richard.henderson@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=laurent@vivier.eu \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.