mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-04 14:46:03 +00:00
...
This commit is contained in:
parent
9fbf23fdcc
commit
1cad40e977
1 changed files with 1 additions and 2 deletions
|
|
@ -108,8 +108,6 @@ copy_between_files(int infd, int outfd, off_t in_pos, size_t len, uint8_t *buf,
|
|||
in_pos += n; len -= n;
|
||||
}
|
||||
#else
|
||||
const size_t bufsz = 1024 * 1024;
|
||||
if (!buf) { errno = ENOMEM; return false; }
|
||||
while (len) {
|
||||
ssize_t amt_read = pread(infd, buf, MIN(len, bufsz), in_pos);
|
||||
if (amt_read < 0) {
|
||||
|
|
@ -184,6 +182,7 @@ defrag(DiskCache *self) {
|
|||
perror("Failed to allocate space for new disk cache file during defrag");
|
||||
goto cleanup;
|
||||
}
|
||||
lseek(new_cache_file, 0, SEEK_SET);
|
||||
#ifndef HAS_SENDFILE
|
||||
buf = malloc(bufsz);
|
||||
if (!buf) goto cleanup;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue