diff options
author | Adrian Prantl <aprantl@apple.com> | 2019-04-24 19:08:43 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2019-04-24 19:08:43 +0000 |
commit | c90ff5e123c5d759697b866a75594d465a8a0591 (patch) | |
tree | fe52558d74d3d2f592ee224a78d619b2489a0276 /llvm/lib/Support/Path.cpp | |
parent | 91cee68e1f0fe3aa22513af6fa6d7308150bcfc9 (diff) | |
download | bcm5719-llvm-c90ff5e123c5d759697b866a75594d465a8a0591.tar.gz bcm5719-llvm-c90ff5e123c5d759697b866a75594d465a8a0591.zip |
Revert using fcopyfile(3) to implement sys::fs::copy_file(Twine, int) on macOS
It turns out that I mesread the man page and fcopyfile(3) does not
actually support COPYFILE_CLONE for files.
<rdar://problem/50148757>
llvm-svn: 359127
Diffstat (limited to 'llvm/lib/Support/Path.cpp')
-rw-r--r-- | llvm/lib/Support/Path.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Support/Path.cpp b/llvm/lib/Support/Path.cpp index 9466591c25e..d60c1359b18 100644 --- a/llvm/lib/Support/Path.cpp +++ b/llvm/lib/Support/Path.cpp @@ -935,7 +935,6 @@ std::error_code create_directories(const Twine &Path, bool IgnoreExisting, return create_directory(P, IgnoreExisting, Perms); } -#ifndef __APPLE__ static std::error_code copy_file_internal(int ReadFD, int WriteFD) { const size_t BufSize = 4096; char *Buf = new char[BufSize]; @@ -960,6 +959,7 @@ static std::error_code copy_file_internal(int ReadFD, int WriteFD) { return std::error_code(); } +#ifndef __APPLE__ std::error_code copy_file(const Twine &From, const Twine &To) { int ReadFD, WriteFD; if (std::error_code EC = openFileForRead(From, ReadFD, OF_None)) @@ -977,6 +977,7 @@ std::error_code copy_file(const Twine &From, const Twine &To) { return EC; } +#endif std::error_code copy_file(const Twine &From, int ToFD) { int ReadFD; @@ -989,7 +990,6 @@ std::error_code copy_file(const Twine &From, int ToFD) { return EC; } -#endif ErrorOr<MD5::MD5Result> md5_contents(int FD) { MD5 Hash; |