aboutsummaryrefslogtreecommitdiff
path: root/tests/tcg/multiarch/linux-test.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tcg/multiarch/linux-test.c')
-rw-r--r--tests/tcg/multiarch/linux-test.c3
1 files changed, 2 insertions, 1 deletions
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);