summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2011-12-24 21:12:09 -0800
committerJeremy Allison <jra@samba.org>2011-12-25 07:46:38 +0100
commiteb617374a673bb1189dd9b6bccbf3f1d9fb91010 (patch)
tree0871168e61bbbcb25a2f1bdd51af267628aad5ff /source3/lib
parentd4e834ec6c8005b8a517185a46ab18d8343b7313 (diff)
downloadsamba-eb617374a673bb1189dd9b6bccbf3f1d9fb91010.tar.gz
samba-eb617374a673bb1189dd9b6bccbf3f1d9fb91010.tar.bz2
samba-eb617374a673bb1189dd9b6bccbf3f1d9fb91010.zip
Fix bug #8679 - recvfile code path using splice() on Linux leaves data in the pipe on short write
Bug found and fix suggested by Andrew Bartlett. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Sun Dec 25 07:46:38 CET 2011 on sn-devel-104
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/recvfile.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/source3/lib/recvfile.c b/source3/lib/recvfile.c
index 7cbb8a0b92..5d1c0b2c55 100644
--- a/source3/lib/recvfile.c
+++ b/source3/lib/recvfile.c
@@ -214,10 +214,9 @@ ssize_t sys_recvfile(int fromfd,
}
done:
- if (total_written < count) {
+ if (count) {
int saved_errno = errno;
- if (drain_socket(fromfd, count-total_written) !=
- count-total_written) {
+ if (drain_socket(fromfd, count) != count) {
/* socket is dead. */
return -1;
}