From 6cff4ecf574f0b18400f7d8ff13d8bd7a0dd352f Mon Sep 17 00:00:00 2001 From: yar Date: Fri, 15 Oct 2004 09:51:36 +0000 Subject: 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 --- libexec/ftpd/ftpd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libexec/ftpd/ftpd.c') 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; -- cgit v1.1