qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stuart Brady <sdbrady@ntlworld.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] avoid compilation warning/errors on up to date compilers
Date: Tue, 16 Jun 2009 19:23:59 +0100	[thread overview]
Message-ID: <20090616182359.GA17188@miranda.arrow> (raw)
In-Reply-To: <20090616150343.GA4350@kos.to>

On Tue, Jun 16, 2009 at 06:03:43PM +0300, Riku Voipio wrote:
> Which tree against did you make these changes? the qemu-ndb.c bit didn't
> apply against HEAD. Also, there are some whitespace/tab issues. See the
> CODING_STYLE doc. Functionally I can verify it removes compiler warnings
> when using a modenr glibc (2.9).

Unfortunately, some of the changes don't look right.

For instance:

> > -    read(s->fd, &bitmap_entry, 1);
> > +    if (read(s->fd, &bitmap_entry, 1) != 1)
> > +	return -1; // not allocated

If read() returns -1 and errno is set to EINTR, then the read() should
be reattempted.

> > -    write(cow_fd, &cow_header, sizeof(cow_header));
> > +    if (write(cow_fd, &cow_header, sizeof(cow_header)) == sizeof(cow_header))
> > +        goto fail;

Doesn't write(...) == sizeof(cow_header) indicate success?

Also, I gather partial reads/writes need to be supported.
-- 
Stuart Brady

  reply	other threads:[~2009-06-16 18:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-16  3:30 [Qemu-devel] [PATCH] avoid compilation warning/errors on up to date compilers Jean-Christophe Dubois
2009-06-16 15:03 ` Riku Voipio
2009-06-16 18:23   ` Stuart Brady [this message]
2009-06-16 20:01     ` Jean-Christophe Dubois
2009-06-16 20:56     ` Anthony Liguori
2009-06-16 21:07       ` Jean-Christophe Dubois

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=20090616182359.GA17188@miranda.arrow \
    --to=sdbrady@ntlworld.com \
    --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).