mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
fix: check createDir return value
Added a check in the createDir function to verify if the file exists (this is not an error) Signed-off-by: Marcel Skierkowski <marcel.skierkowski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
523e53c862
commit
c54c88c7f6
@@ -1655,7 +1655,12 @@ void OfflineCompiler::writeOutAllFiles() {
|
||||
int OfflineCompiler::createDir(const std::string &path) {
|
||||
auto result = IoFunctions::mkdirPtr(path.c_str());
|
||||
if (result != 0) {
|
||||
return OCLOC_INVALID_FILE;
|
||||
if (errno == EEXIST) {
|
||||
// Directory already exists, not an error
|
||||
return OCLOC_SUCCESS;
|
||||
} else {
|
||||
return OCLOC_INVALID_FILE;
|
||||
}
|
||||
}
|
||||
return OCLOC_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user