|
From: | Richard Henderson |
Subject: | Re: [PATCH v2 2/9] bsd-user/mmap.c: check pread's return value to fix warnings with _FORTIFY_SOURCE |
Date: | Thu, 23 Sep 2021 10:36:53 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 |
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. r~
[Prev in Thread] | Current Thread | [Next in Thread] |