diff --git a/src/path.cpp b/src/path.cpp index a5ad76b2d..6cc64048e 100644 --- a/src/path.cpp +++ b/src/path.cpp @@ -80,12 +80,21 @@ static bool path_get_path_core(const wcstring &cmd, wcstring *out_path, err = EACCES; } else { switch (errno) { - case ENOENT: - case ENAMETOOLONG: case EACCES: + case ENAMETOOLONG: + case ENOENT: case ENOTDIR: { break; } +#ifdef __sun + //Solaris 5.11 can return any of the following three if the path + //does not exist. Yes, even 0. No, none of this is documented. + case 0: + case EAGAIN: + case EEXIST: { + break; + } +#endif //WSL has a bug where access(2) can return EINVAL //See https://github.com/Microsoft/BashOnWindows/issues/2522 //The only other way EINVAL can happen is if the wrong