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
llvm-svn: 289563
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);
int DuplicateFile(int Fd);
-void DeleteFile(const std::string &Path);
+void RemoveFile(const std::string &Path);
} // namespace fuzzer
return dup(Fd);
}
-void DeleteFile(const std::string &Path) {
+void RemoveFile(const std::string &Path) {
unlink(Path.c_str());
}
return _dup(Fd);
}
-void DeleteFile(const std::string &Path) {
+void RemoveFile(const std::string &Path) {
_unlink(Path.c_str());
}
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";
for (auto &F: NewFiles)
WriteToOutputCorpus(FileToVector(F));
// We are done, delete the control file.
- DeleteFile(CFPath);
+ RemoveFile(CFPath);
}
} // namespace fuzzer