mirror of
https://github.com/samba-team/samba.git
synced 2025-02-02 09:47:23 +03:00
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
This commit is contained in:
parent
d4e834ec6c
commit
eb617374a6
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user