[master] 91a858401 Support VSB_tofile() partial writes

Nils Goroll nils.goroll at uplex.de
Mon Oct 2 12:21:53 UTC 2023


On 02.10.23 14:17, Dridi Boukelmoune wrote:
>> +       sz = (typeof(sz))s->s_len;
>> +       while (sz > 0) {
>> +               r = write(fd, p, sz);
>> +               if (r < 0)
>> +                       return (-1);
>> +               assert(r <= sz);
>> +               p += r;
>> +               sz -= r;
>> +       }
>> +       return (r >= 0 ? 0 : -1);
> Aren't we guaranteed to have r >= 0 here?

not for sz == 0

-- 

Nils Goroll (he/him)

** * * UPLEX - Nils Goroll Systemoptimierung

Scheffelstraße 32
22301 Hamburg

tel +49 40 28805731
mob +49 170 2723133
fax +49 40 42949753

xmpp://slink@jabber.int.uplex.de/

http://uplex.de/



More information about the varnish-commit mailing list