logo

utils-std

Collection of commonly available Unix tools
commit: cfee46ca8f51773fc9796a31c71e4a2ee0abadef
parent 3546c98aad5457db9eea94b3bf4d78f89062b0db
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Wed,  8 May 2024 01:26:53 +0200

cmd/install: reset errno after EXDEV

Diffstat:

Mcmd/install.c6+++++-
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; }