mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Merge pull request #753 from Tetralux/fix-dirnoexist-error
Fix error message when importing package that does not exist
This commit is contained in:
+14
-1
@@ -968,7 +968,20 @@ ReadDirectoryError read_directory(String path, Array<FileInfo> *fi) {
|
|||||||
|
|
||||||
DIR *dir = opendir(c_path);
|
DIR *dir = opendir(c_path);
|
||||||
if (!dir) {
|
if (!dir) {
|
||||||
return ReadDirectory_NotDir;
|
switch (errno) {
|
||||||
|
case ENOENT:
|
||||||
|
return ReadDirectory_NotExists;
|
||||||
|
case EACCES:
|
||||||
|
return ReadDirectory_Permission;
|
||||||
|
case ENOTDIR:
|
||||||
|
return ReadDirectory_NotDir;
|
||||||
|
default:
|
||||||
|
// ENOMEM: out of memory
|
||||||
|
// EMFILE: per-process limit on open fds reached
|
||||||
|
// ENFILE: system-wide limit on total open files reached
|
||||||
|
return ReadDirectory_Unknown;
|
||||||
|
}
|
||||||
|
GB_PANIC("unreachable");
|
||||||
}
|
}
|
||||||
|
|
||||||
array_init(fi, a, 0, 100);
|
array_init(fi, a, 0, 100);
|
||||||
|
|||||||
Reference in New Issue
Block a user