]> gitweb.ps.run Git - ps-cgit/commitdiff
cache: tolerate short writes in print_slot
authorHristo Venev <hristo@venev.name>
Sat, 7 May 2022 17:07:00 +0000 (20:07 +0300)
committerJason A. Donenfeld <Jason@zx2c4.com>
Mon, 19 Dec 2022 15:13:58 +0000 (16:13 +0100)
sendfile() can return after a short read/write, so we may need to call
it more than once. As suggested in the manual page, we fall back to
read/write if sendfile fails with EINVAL or ENOSYS.

On the read/write path, use write_in_full which deals with short writes.

Signed-off-by: Hristo Venev <hristo@venev.name>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>

No differences found