mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-09 20:13:35 +00:00
[libFuzzer] Avoid name collision with Windows API.
Windows uses some macros to replace DeleteFile() by DeleteFileA() or DeleteFileW(). This was causing an error at link time. DeleteFile was renamed to RemoveFile(). Differential Revision: https://reviews.llvm.org/D27577 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289563 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fed659a90c
commit
fae92e9e69
@ -119,7 +119,7 @@ class InputCorpus {
|
||||
void DeleteInput(size_t Idx) {
|
||||
InputInfo &II = *Inputs[Idx];
|
||||
if (!OutputCorpus.empty() && II.MayDeleteFile)
|
||||
DeleteFile(DirPlusFile(OutputCorpus, Sha1ToString(II.Sha1)));
|
||||
RemoveFile(DirPlusFile(OutputCorpus, Sha1ToString(II.Sha1)));
|
||||
Unit().swap(II.U);
|
||||
if (FeatureDebug)
|
||||
Printf("EVICTED %zd\n", Idx);
|
||||
|
@ -57,7 +57,7 @@ int CloseFile(int Fd);
|
||||
|
||||
int DuplicateFile(int Fd);
|
||||
|
||||
void DeleteFile(const std::string &Path);
|
||||
void RemoveFile(const std::string &Path);
|
||||
|
||||
} // namespace fuzzer
|
||||
|
||||
|
@ -71,7 +71,7 @@ int DuplicateFile(int Fd) {
|
||||
return dup(Fd);
|
||||
}
|
||||
|
||||
void DeleteFile(const std::string &Path) {
|
||||
void RemoveFile(const std::string &Path) {
|
||||
unlink(Path.c_str());
|
||||
}
|
||||
|
||||
|
@ -135,7 +135,7 @@ int DuplicateFile(int Fd) {
|
||||
return _dup(Fd);
|
||||
}
|
||||
|
||||
void DeleteFile(const std::string &Path) {
|
||||
void RemoveFile(const std::string &Path) {
|
||||
_unlink(Path.c_str());
|
||||
}
|
||||
|
||||
|
@ -221,7 +221,7 @@ void Fuzzer::CrashResistantMerge(const std::vector<std::string> &Args,
|
||||
std::string CFPath =
|
||||
"libFuzzerTemp." + std::to_string(GetPid()) + ".txt";
|
||||
// Write the control file.
|
||||
DeleteFile(CFPath);
|
||||
RemoveFile(CFPath);
|
||||
std::ofstream ControlFile(CFPath);
|
||||
ControlFile << AllFiles.size() << "\n";
|
||||
ControlFile << NumFilesInFirstCorpus << "\n";
|
||||
@ -253,7 +253,7 @@ void Fuzzer::CrashResistantMerge(const std::vector<std::string> &Args,
|
||||
for (auto &F: NewFiles)
|
||||
WriteToOutputCorpus(FileToVector(F));
|
||||
// We are done, delete the control file.
|
||||
DeleteFile(CFPath);
|
||||
RemoveFile(CFPath);
|
||||
}
|
||||
|
||||
} // namespace fuzzer
|
||||
|
Loading…
x
Reference in New Issue
Block a user