qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Arnaud Patard <arnaud.patard@rtp-net.org>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 12/14] linux-user/mmap.c: fix warnings with _FORTIFY_SOURCE
Date: Sat, 2 Jan 2010 04:09:41 +0200	[thread overview]
Message-ID: <cc557aab1001011809y1cb0fff1k23dea636d4574313@mail.gmail.com> (raw)
In-Reply-To: <87oclfa03j.fsf@lechat.rtp-net.org>

On Thu, Dec 31, 2009 at 12:50 PM, Arnaud Patard
<arnaud.patard@rtp-net.org> wrote:
> "Kirill A. Shutemov" <kirill@shutemov.name> writes:
>
> Hi,
>
>>   CC    i386-linux-user/mmap.o
>> cc1: warnings being treated as errors
>> /usr/src/RPM/BUILD/qemu-0.11.92/linux-user/mmap.c: In function 'mmap_frag':
>> /usr/src/RPM/BUILD/qemu-0.11.92/linux-user/mmap.c:253: error: ignoring return value of 'pread', declared with attribute warn_unused_result
>> /usr/src/RPM/BUILD/qemu-0.11.92/linux-user/mmap.c: In function 'target_mmap':
>> /usr/src/RPM/BUILD/qemu-0.11.92/linux-user/mmap.c:477: error: ignoring return value of 'pread', declared with attribute warn_unused_result
>> make[1]: *** [mmap.o] Error 1
>>
>> Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
>> ---
>>  linux-user/mmap.c |    6 ++++--
>>  1 files changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/linux-user/mmap.c b/linux-user/mmap.c
>> index 144fb7c..e496c64 100644
>> --- a/linux-user/mmap.c
>> +++ b/linux-user/mmap.c
>> @@ -250,7 +250,8 @@ static int mmap_frag(abi_ulong real_start,
>>              mprotect(host_start, qemu_host_page_size, prot1 | PROT_WRITE);
>>
>>          /* read the corresponding file data */
>> -        pread(fd, g2h(start), end - start, offset);
>> +        if (pread(fd, g2h(start), end - start, offset) == -1)
>> +            return -errno;
>
> This needs to be checked but iirc, it's wrong. One should set errno and
> return -1. Please double check and fix if needed.

Thanks.

      parent reply	other threads:[~2010-01-02  2:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1262223266-19191-1-git-send-email-kirill@shutemov.name>
     [not found] ` <1262223266-19191-2-git-send-email-kirill@shutemov.name>
     [not found]   ` <1262223266-19191-3-git-send-email-kirill@shutemov.name>
     [not found]     ` <1262223266-19191-4-git-send-email-kirill@shutemov.name>
     [not found]       ` <1262223266-19191-5-git-send-email-kirill@shutemov.name>
     [not found]         ` <87k4w39zra.fsf@lechat.rtp-net.org>
2010-01-02  2:06           ` [Qemu-devel] [PATCH 14/14] Add -fstack-protector-all to CFLAGS Kirill A. Shutemov
     [not found]     ` <87oclfa03j.fsf@lechat.rtp-net.org>
2010-01-02  2:09       ` Kirill A. Shutemov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cc557aab1001011809y1cb0fff1k23dea636d4574313@mail.gmail.com \
    --to=kirill@shutemov.name \
    --cc=arnaud.patard@rtp-net.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).