[Libguestfs] [PATCH v3 1/4] file: Avoid unsupported fallocate() calls

Nir Soffer nsoffer at redhat.com
Sun Aug 19 14:14:09 UTC 2018


On Sun, Aug 19, 2018 at 2:38 PM Richard W.M. Jones <rjones at redhat.com>
wrote:

> On Sun, Aug 19, 2018 at 01:13:05AM +0300, Nir Soffer wrote:
> > -    if (r == -1 && errno != EOPNOTSUPP) {
> > +    if (r == 0)
> > +      return r;
> > +
> > +    if (errno != EOPNOTSUPP) {
> >        nbdkit_error ("zero: %m");
> > +      return r;
>
> I think these cases where we "return r" are rather awkward
> (there are more of them in this commit).
>
> I think we should return 0 or return -1 as appropriate.  It seems
> clearer to me and has less risk of going wrong in future
> if we rearrange the code.
>

I agree, I tried to keep the current style of the module.


>
> Rich.
>
> --
> Richard Jones, Virtualization Group, Red Hat
> http://people.redhat.com/~rjones
> Read my programming and virtualization blog: http://rwmj.wordpress.com
> virt-builder quickly builds VMs from scratch
> http://libguestfs.org/virt-builder.1.html
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20180819/00aafef3/attachment.htm>


More information about the Libguestfs mailing list