commit: b6c418f389cd9cbb22c421b32aac4ed91831e61d
parent 1f1969b8deeddcc98b46e0b5f49acc4be3575c7e
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Wed, 8 May 2024 01:26:53 +0200
cmd/install: reset errno after EXDEV
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/cmd/install.c b/cmd/install.c
@@ -63,7 +63,11 @@ auto_file_copy(int fd_in, int fd_out, off_t len, int flags)
ret = copy_file_range(fd_in, NULL, fd_out, NULL, len, 0);
if(ret < 0)
{
- if(errno == EXDEV) return manual_file_copy(fd_in, fd_out, len, flags);
+ if(errno == EXDEV)
+ {
+ errno = 0;
+ return manual_file_copy(fd_in, fd_out, len, flags);
+ }
return ret;
}