qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 2/9] bsd-user/mmap.c: check pread's return value to fix wa


From: Warner Losh
Subject: Re: [PATCH v2 2/9] bsd-user/mmap.c: check pread's return value to fix warnings with _FORTIFY_SOURCE
Date: Fri, 24 Sep 2021 09:07:40 -0600



On Fri, Sep 24, 2021 at 5:59 AM Richard Henderson <richard.henderson@linaro.org> wrote:
On 9/21/21 9:56 PM, Warner Losh wrote:
> From: Mikaël Urankar <mikael.urankar@gmail.com>
>
> Simmilar to the equivalent linux-user: commit fb7e378cf9c, which added
> checking to pread's return value.
>
> Signed-off-by: Mikaël Urankar <mikael.urankar@gmail.com>
> Signed-off-by: Warner Losh <imp@bsdimp.com>
> ---
>   bsd-user/mmap.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

> -        pread(fd, g2h_untagged(start), end - start, offset);
> +        if (pread(fd, g2h_untagged(start), end - start, offset) == -1)
> +            return -1;

If it's not too annoying wrt rebasing other cleanups, please add the braces now.

You bet.
 

r~

reply via email to

[Prev in Thread] Current Thread [Next in Thread]