tests/tcg/multiarch/linux-test: Fix error check for shmat
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: <20191106113318.10226-3-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
This commit is contained in:
parent
7c81570d93
commit
3d72543494
@ -503,8 +503,9 @@ static void test_shm(void)
|
|||||||
|
|
||||||
shmid = chk_error(shmget(IPC_PRIVATE, SHM_SIZE, IPC_CREAT | 0777));
|
shmid = chk_error(shmget(IPC_PRIVATE, SHM_SIZE, IPC_CREAT | 0777));
|
||||||
ptr = shmat(shmid, NULL, 0);
|
ptr = shmat(shmid, NULL, 0);
|
||||||
if (!ptr)
|
if (ptr == (void *)-1) {
|
||||||
error("shmat");
|
error("shmat");
|
||||||
|
}
|
||||||
|
|
||||||
memset(ptr, 0, SHM_SIZE);
|
memset(ptr, 0, SHM_SIZE);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user