commit - 9439b99a9a4c551109d11217916f1d5118ca556d
commit + 89077ea14658e1570e753363db927fe0138c7a4b
blob - be583ed204cfaf9383958c978c1f8e80d382415f
blob + 916500e1af93b9e7112840c8d0c9c4e46d0a67f2
--- lib/serve.c
+++ lib/serve.c
pack_chunksize = sizeof(buf);
for (;;) {
- ssize_t r, w;
+ ssize_t r;
r = read(packfd, use_sidebands ? &buf[1] : buf,
pack_chunksize);
if (err)
break;
} else {
- w = write(outfd, buf, r);
- if (w == -1) {
- err = got_error_from_errno("write");
- break;
- } else if (w != r) {
- err = got_error(GOT_ERR_IO);
+ err = got_poll_write_full(outfd, buf, r);
+ if (err) {
+ if (err->code == GOT_ERR_EOF)
+ err = NULL;
break;
}
}