summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2015-02-16 13:26:29 +0000
committerJeremy Allison <jra@samba.org>2015-02-24 17:52:09 +0100
commit6e94f695c4cb8aabc57b5ef00073c2301fec409a (patch)
tree0de405ec8b5819d7282445e1b93e33ae75a2dc62 /lib
parent0a20ffb17dcc849834ccde4aa3f751bda31f8824 (diff)
downloadsamba-6e94f695c4cb8aabc57b5ef00073c2301fec409a.tar.gz
samba-6e94f695c4cb8aabc57b5ef00073c2301fec409a.tar.xz
samba-6e94f695c4cb8aabc57b5ef00073c2301fec409a.zip
iov_buf: Add an explaining comment
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'lib')
-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)) {