Handle odd return codes for waccess(..) in src/path.cpp under Solaris

This commit is contained in:
Mahmoud Al-Qudsi
2018-06-17 19:55:31 -05:00
parent 2443ea92c3
commit a6d64c1086

View File

@@ -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