mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-30 22:58:46 +00:00
postfork: Also check shebang/interpreter for EACCESS
This happens e.g. with a shebang of "#!/bin/" - we would complain about EACCESS, even tho accessing *the file to run* worked.
This commit is contained in:
parent
afd242b14d
commit
ead0b03108
1 changed files with 5 additions and 7 deletions
|
@ -453,6 +453,7 @@ void safe_report_exec_error(int err, const char *actual_cmd, const char *const *
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case EACCES:
|
||||||
case ENOENT: {
|
case ENOENT: {
|
||||||
// ENOENT is returned by exec() when the path fails, but also returned by posix_spawn if
|
// ENOENT is returned by exec() when the path fails, but also returned by posix_spawn if
|
||||||
// an open file action fails. These cases appear to be impossible to distinguish. We
|
// an open file action fails. These cases appear to be impossible to distinguish. We
|
||||||
|
@ -481,24 +482,21 @@ void safe_report_exec_error(int err, const char *actual_cmd, const char *const *
|
||||||
"Failed to execute process '%s': The file exists and is executable. "
|
"Failed to execute process '%s': The file exists and is executable. "
|
||||||
"Check the interpreter or linker?",
|
"Check the interpreter or linker?",
|
||||||
actual_cmd);
|
actual_cmd);
|
||||||
} else {
|
} else if (err == ENOENT) {
|
||||||
FLOGF_SAFE(exec,
|
FLOGF_SAFE(exec,
|
||||||
"Failed to execute process '%s': The file does not exist or could not "
|
"Failed to execute process '%s': The file does not exist or could not "
|
||||||
"be executed.",
|
"be executed.",
|
||||||
actual_cmd);
|
actual_cmd);
|
||||||
|
} else {
|
||||||
|
FLOGF_SAFE(exec, "Failed to execute process '%s': The file could not be accessed.",
|
||||||
|
actual_cmd);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case ENOMEM: {
|
case ENOMEM: {
|
||||||
FLOGF_SAFE(exec, "Out of memory");
|
FLOGF_SAFE(exec, "Out of memory");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case EACCES: {
|
|
||||||
FLOGF_SAFE(exec, "Failed to execute process '%s': The file could not be accessed.",
|
|
||||||
actual_cmd);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case ETXTBSY: {
|
case ETXTBSY: {
|
||||||
FLOGF_SAFE(exec, "Failed to execute process '%s': File is currently open for writing.",
|
FLOGF_SAFE(exec, "Failed to execute process '%s': File is currently open for writing.",
|
||||||
actual_cmd);
|
actual_cmd);
|
||||||
|
|
Loading…
Reference in a new issue