qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] avoid compilation warning/errors on up to date


From: Stuart Brady
Subject: Re: [Qemu-devel] [PATCH] avoid compilation warning/errors on up to date compilers
Date: Tue, 16 Jun 2009 19:23:59 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

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 via email to

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