Lines Matching refs:local_fd
1159 int local_fd = -1, write_error; in do_download() local
1222 local_fd = open(local_path, in do_download()
1224 if (local_fd == -1) { in do_download()
1231 if (fstat(local_fd, &st) == -1) { in do_download()
1247 if (local_fd != -1) in do_download()
1248 close(local_fd); in do_download()
1330 if ((lseek(local_fd, req->offset, SEEK_SET) == -1 || in do_download()
1331 atomicio(vwrite, local_fd, data, len) != len) && in do_download()
1396 if (ftruncate(local_fd, highwater) == -1) in do_download()
1417 if (preserve_flag && fchmod(local_fd, mode) == -1) in do_download()
1435 if (fsync(local_fd) == -1) in do_download()
1440 close(local_fd); in do_download()
1562 int r, local_fd; in do_upload() local
1585 if ((local_fd = open(local_path, O_RDONLY, 0)) == -1) { in do_upload()
1590 if (fstat(local_fd, &sb) == -1) { in do_upload()
1593 close(local_fd); in do_upload()
1598 close(local_fd); in do_upload()
1612 close(local_fd); in do_upload()
1619 close(local_fd); in do_upload()
1623 if (lseek(local_fd, (off_t)c->size, SEEK_SET) == -1) { in do_upload()
1624 close(local_fd); in do_upload()
1649 close(local_fd); in do_upload()
1675 len = read(local_fd, data, conn->transfer_buflen); in do_upload()
1758 if (close(local_fd) == -1) { in do_upload()