summaryrefslogtreecommitdiffstats
path: root/lib/util/iov_buf.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/util/iov_buf.c')
-rw-r--r--lib/util/iov_buf.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/util/iov_buf.c b/lib/util/iov_buf.c
index 82a4af5323..d260b2fea8 100644
--- a/lib/util/iov_buf.c
+++ b/lib/util/iov_buf.c
@@ -75,6 +75,10 @@ bool iov_advance(struct iovec **iov, int *iovcnt, size_t n)
/*
* Skip 0-length iovec's
+ *
+ * There might be empty buffers at the end of iov. Next time we do a
+ * readv/writev based on this iov would give 0 transferred bytes, also
+ * known as EPIPE. So we need to be careful discarding them.
*/
while ((cnt > 0) && (v->iov_len == 0)) {