From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: laurent@vivier.eu
Subject: [Qemu-devel] [PATCH 1/3] tests/tcg/multiarch/linux-test: Fix error check for shmat
Date: Tue, 16 Oct 2018 18:54:54 -0700 [thread overview]
Message-ID: <20181017015456.3293-2-richard.henderson@linaro.org> (raw)
In-Reply-To: <20181017015456.3293-1-richard.henderson@linaro.org>
The error indicator for this syscall is -1, not 0.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
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 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);
--
2.17.2
next prev parent reply other threads:[~2018-10-17 1:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-17 1:54 [Qemu-devel] [PATCH 0/3] linux-user: Fix shmat by honoring SHMLBA Richard Henderson
2018-10-17 1:54 ` Richard Henderson [this message]
2018-10-17 1:54 ` [Qemu-devel] [PATCH 2/3] linux-user: Fix shmat emulation by honoring host SHMLBA Richard Henderson
2018-10-17 1:54 ` [Qemu-devel] [PATCH 3/3] linux-user: Align mmap_find_vma to host page size Richard Henderson
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=20181017015456.3293-2-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).