summaryrefslogtreecommitdiffstats
path: root/libexec/ftpd/ftpd.c
diff options
context:
space:
mode:
Diffstat (limited to 'libexec/ftpd/ftpd.c')
-rw-r--r--libexec/ftpd/ftpd.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index 60b1bf9..6c71150 100644
--- a/libexec/ftpd/ftpd.c
+++ b/libexec/ftpd/ftpd.c
@@ -1781,7 +1781,6 @@ send_data(FILE *instr, FILE *outstr, off_t blksize, off_t filesize, int isreg)
{
int c, filefd, netfd;
char *buf;
- size_t len;
off_t cnt;
transflag++;
@@ -1824,17 +1823,16 @@ send_data(FILE *instr, FILE *outstr, off_t blksize, off_t filesize, int isreg)
off_t offset;
int err;
- len = filesize;
err = cnt = offset = 0;
- while (err != -1 && cnt < filesize) {
- err = sendfile(filefd, netfd, offset, len,
+ while (err != -1 && filesize > 0) {
+ err = sendfile(filefd, netfd, offset, 0,
(struct sf_hdtr *) NULL, &cnt, 0);
if (recvurg)
goto got_oob;
byte_count += cnt;
offset += cnt;
- len -= cnt;
+ filesize -= cnt;
if (err == -1) {
if (!cnt)
OpenPOWER on IntegriCloud