<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Sun, Aug 19, 2018 at 2:38 PM Richard W.M. Jones <<a href="mailto:rjones@redhat.com">rjones@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Sun, Aug 19, 2018 at 01:13:05AM +0300, Nir Soffer wrote:<br>
> -    if (r == -1 && errno != EOPNOTSUPP) {<br>
> +    if (r == 0)<br>
> +      return r;<br>
> +<br>
> +    if (errno != EOPNOTSUPP) {<br>
>        nbdkit_error ("zero: %m");<br>
> +      return r;<br>
<br>
I think these cases where we "return r" are rather awkward<br>
(there are more of them in this commit).<br>
<br>
I think we should return 0 or return -1 as appropriate.  It seems<br>
clearer to me and has less risk of going wrong in future<br>
if we rearrange the code.<br></blockquote><div><br></div><div>I agree, I tried to keep the current style of the module.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Rich.<br>
<br>
-- <br>
Richard Jones, Virtualization Group, Red Hat <a href="http://people.redhat.com/~rjones" rel="noreferrer" target="_blank">http://people.redhat.com/~rjones</a><br>
Read my programming and virtualization blog: <a href="http://rwmj.wordpress.com" rel="noreferrer" target="_blank">http://rwmj.wordpress.com</a><br>
virt-builder quickly builds VMs from scratch<br>
<a href="http://libguestfs.org/virt-builder.1.html" rel="noreferrer" target="_blank">http://libguestfs.org/virt-builder.1.html</a><br>
</blockquote></div></div>