mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-28 07:05:03 +00:00
Support/Path: remove raw delete
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216360 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0901b15d01
commit
0acfd7f0a4
@ -881,7 +881,8 @@ std::error_code copy_file(const Twine &From, const Twine &To) {
|
||||
}
|
||||
|
||||
const size_t BufSize = 4096;
|
||||
char *Buf = new char[BufSize];
|
||||
std::vector<char> Buffer(BufSize);
|
||||
char *Buf = Buffer.data();
|
||||
int BytesRead = 0, BytesWritten = 0;
|
||||
for (;;) {
|
||||
BytesRead = read(ReadFD, Buf, BufSize);
|
||||
@ -898,7 +899,6 @@ std::error_code copy_file(const Twine &From, const Twine &To) {
|
||||
}
|
||||
close(ReadFD);
|
||||
close(WriteFD);
|
||||
delete[] Buf;
|
||||
|
||||
if (BytesRead < 0 || BytesWritten < 0)
|
||||
return std::error_code(errno, std::generic_category());
|
||||
|
Loading…
Reference in New Issue
Block a user