mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-30 16:28:30 +00:00
Work around copy_file_range() bug in eCryptFs
When programs like ar.ape and compile.ape are run on eCryptFs partitions on Linux, copy_file_range() will fail with EINVAL which is wrong because eCryptFs which doesn't support this system call, should raise EOPNOTSUPP See https://github.com/jart/cosmopolitan/discussions/1305
This commit is contained in:
parent
12cc2de22e
commit
fef24d622a
5 changed files with 9 additions and 3 deletions
|
@ -798,7 +798,11 @@ bool MovePreservingDestinationInode(const char *from, const char *to) {
|
|||
rc = copy_file_range(fdin, 0, fdout, 0, remain, 0);
|
||||
if (rc != -1) {
|
||||
remain -= rc;
|
||||
} else if (errno == EXDEV || errno == ENOSYS) {
|
||||
} else if (errno == EXDEV || // different partitions
|
||||
errno == EINVAL || // possible w/ ecryptfs
|
||||
errno == ENOSYS || // not linux or freebsd
|
||||
errno == ENOTSUP || // no fs support for it
|
||||
errno == EOPNOTSUPP) {
|
||||
if (lseek(fdin, 0, SEEK_SET) == -1) {
|
||||
res = false;
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue