mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-22 00:22:57 -05:00
fix(libc): map directory symlink loop errors
(cherry picked from commit d5e348c7b6)
This commit is contained in:
1 parent
df6b831400
commit
c96100aff1
2 files changed
+10
No files matched your search
@@ -17,6 +17,9 @@ int DirectoryError(int error) {
|
||||
case ENFILE: return 23;
|
||||
case ENOMEM: return 12;
|
||||
case ENAMETOOLONG: return 63;
|
||||
#ifdef ELOOP
|
||||
case ELOOP: return 62;
|
||||
#endif
|
||||
default: return 5;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +42,13 @@ int main() {
|
||||
Require(closedir_nid_postfix(directory) == 0);
|
||||
Require(opendir_nid_postfix((root / "missing").string().c_str()) == nullptr);
|
||||
Require(*__error_nid_postfix() == 2);
|
||||
#ifndef _WIN32
|
||||
const auto symlinkLoop = root / "symlink-loop";
|
||||
std::filesystem::create_symlink("symlink-loop", symlinkLoop);
|
||||
Require(opendir_nid_postfix(symlinkLoop.string().c_str()) == nullptr);
|
||||
Require(*__error_nid_postfix() == 62);
|
||||
Require(std::filesystem::remove(symlinkLoop));
|
||||
#endif
|
||||
Require(opendir_nid_postfix((root / "sample.txt").string().c_str()) == nullptr);
|
||||
Require(*__error_nid_postfix() == 20);
|
||||
Require(opendir_nid_postfix("") == nullptr && *__error_nid_postfix() == 2);
|
||||
|
||||
Reference in new issue
Block a user