[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 02/12] tests/tcg/multiarch/linux-test: Fix error check for
From: |
Laurent Vivier |
Subject: |
Re: [PATCH v2 02/12] tests/tcg/multiarch/linux-test: Fix error check for shmat |
Date: |
Tue, 5 Nov 2019 10:45:01 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 |
Le 25/10/2019 à 13:39, Richard Henderson a écrit :
> The error indicator for this syscall is -1, not 0.
>
> Reviewed-by: Laurent Vivier <address@hidden>
> Signed-off-by: Richard Henderson <address@hidden>
> ---
> 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);
>
>
Applied to my linux-user branch.
Thanks,
Laurent
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH v2 02/12] tests/tcg/multiarch/linux-test: Fix error check for shmat,
Laurent Vivier <=