diff options
author | yar <yar@FreeBSD.org> | 2004-10-15 09:51:36 +0000 |
---|---|---|
committer | yar <yar@FreeBSD.org> | 2004-10-15 09:51:36 +0000 |
commit | 6cff4ecf574f0b18400f7d8ff13d8bd7a0dd352f (patch) | |
tree | 73d925f3bb3234ecf8796d12c68237b139e2fd5b /libexec | |
parent | e6e865ec71476755892cc14cfe35809ae34f8e47 (diff) | |
download | FreeBSD-src-6cff4ecf574f0b18400f7d8ff13d8bd7a0dd352f.zip FreeBSD-src-6cff4ecf574f0b18400f7d8ff13d8bd7a0dd352f.tar.gz |
We must not fall back to the old way (read-write)
if sendfile() transferred some data before throwing
a error condition because sendfile() won't move the
file offset for read() to start from.
MFC after: 2 weeks
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/ftpd/ftpd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index 271bd2f..e8e25b4 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -2058,7 +2058,7 @@ send_data(FILE *instr, FILE *outstr, off_t blksize, off_t filesize, int isreg) filesize -= cnt; if (err == -1) { - if (!cnt) + if (cnt == 0 && offset == 0) goto oldway; goto data_err; |