mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-30 06:44:19 +01:00
Fix broken VFS directory creation
This commit is contained in:
parent
3518e04a18
commit
a09414424b
@ -39,14 +39,16 @@ namespace skyline::vfs {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool OsFileSystem::CreateDirectoryImpl(const std::string &path, bool parents) {
|
bool OsFileSystem::CreateDirectoryImpl(const std::string &path, bool parents) {
|
||||||
|
auto fullPath{basePath + path};
|
||||||
|
|
||||||
if (!parents) {
|
if (!parents) {
|
||||||
int ret{mkdir(path.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH)};
|
int ret{mkdir(fullPath.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH)};
|
||||||
return ret == 0 || errno == EEXIST;
|
return ret == 0 || errno == EEXIST;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto dir{basePath.begin()}; dir != basePath.end(); dir++) {
|
for (auto dir{fullPath.begin()}; dir != fullPath.end(); dir++) {
|
||||||
auto nextDir{std::find(dir, basePath.end(), '/')};
|
auto nextDir{std::find(dir, fullPath.end(), '/')};
|
||||||
auto nextPath{"/" + std::string(basePath.begin(), nextDir)};
|
auto nextPath{"/" + std::string(fullPath.begin(), nextDir)};
|
||||||
|
|
||||||
int ret{mkdir(nextPath.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH)};
|
int ret{mkdir(nextPath.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH)};
|
||||||
if (ret < 0 && errno != EEXIST && errno != EPERM)
|
if (ret < 0 && errno != EEXIST && errno != EPERM)
|
||||||
|
Loading…
Reference in New Issue
Block a user