Skip to main content

isgooderr

Function isgooderr 

Source
pub fn isgooderr(e: i32, dir: &str) -> bool
Expand description

Port of int isgooderr(int e, char *dir) from Src/exec.c:652.

C body:

/* Maybe the directory was unreadable, or maybe it wasn't even a directory. */
return ((e != EACCES || !access(dir, X_OK)) &&
        e != ENOENT && e != ENOTDIR);

errno classifier for execve failures during PATH search: if the errno is EACCES (and the dir is X-accessible) or ENOENT/ENOTDIR, it’s “expected” (try next PATH entry); otherwise it’s a real failure worth surfacing.