mirror of
https://github.com/Kitware/CMake.git
synced 2026-03-09 10:00:12 -05:00
Merge branch 'backport-3.24-file-install-macos' into release-3.24
Merge-request: !8293
This commit is contained in:
@@ -2483,6 +2483,12 @@ Status SystemTools::CloneFileContent(std::string const& source,
|
||||
return status;
|
||||
#elif defined(__APPLE__) && \
|
||||
defined(KWSYS_SYSTEMTOOLS_HAVE_MACOS_COPYFILE_CLONE)
|
||||
// When running as root, copyfile() copies more metadata than we
|
||||
// want, such as ownership. Pretend it is not available.
|
||||
if (getuid() == 0) {
|
||||
return Status::POSIX(ENOSYS);
|
||||
}
|
||||
|
||||
// NOTE: we cannot use `clonefile` as the {a,c,m}time for the file needs to
|
||||
// be updated by `copy_file_if_different` and `copy_file`.
|
||||
if (copyfile(source.c_str(), destination.c_str(), nullptr,
|
||||
|
||||
Reference in New Issue
Block a user