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

Re: [libvirt] [PATCH] Fix safezero()



According to Jiri Denemark on 3/2/2010 8:11 AM:
> Various safezero() implementations used either -1, errno or -errno
> return values. This patch fixes them all to return -1 and set errno
> appropriately.

Correct move, to match the semantics of the HAVE_POSIX_FALLOCATE version.

> 
> There was also a bug in size parameter passed to safewrite() which could
> result in an attempt to write gigabytes out of a megabyte buffer.

Good catch, since len is off_t.

>      while (remain) {
>          if (bytes > remain)
>              bytes = remain;
>  
> -        r = safewrite(fd, buf, len);
> +        r = safewrite(fd, buf, bytes);

ACK.

-- 
Eric Blake   eblake redhat com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


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