Il 26/09/2012 12:00, Kevin Wolf ha scritto:
>> > +
>> > +        ret = write(fd, (void *)&acb, sizeof(acb));
>> > +        if (ret >= 0) {
>> > +            break;
>> > +        }
>> > +        if (errno == EINTR) {
>> > +            continue;
>> > +        }
>> > +        if (errno != EAGAIN) {
>> > +            break;
>> > +        }
> Variatio delectat? ;-)
> 
> How about just do { ... } while (errno == EINTR || errno == EAGAIN); ?

That should be

while ((ret < 0) && (errno == EINTR || errno == EAGAIN));

However, fd here is blocking, so you can just use qemu_write_full.

Paolo


Reply via email to