Add error for EBADARCH

That's apparently errno 86 on macOS, and it's triggered when the
architecture is wrong.

I'll leave other macOS errors to the macOS users.

See #9052.

(cherry picked from commit 60f87ef3be)
This commit is contained in:
Fabian Boehm 2022-07-02 10:11:00 +02:00 committed by David Adam
parent 98838ac429
commit 4c2ce4b931
2 changed files with 9 additions and 0 deletions

View File

@ -7,6 +7,7 @@ This release of fish introduces the following small enhancements:
- ``printf`` returns a better error when used with arguments interpreted as octal numbers (:issue:`9035`). - ``printf`` returns a better error when used with arguments interpreted as octal numbers (:issue:`9035`).
- New completions for ``qdbus`` (:issue:`9031:`) and ``reflector`` (:issue:`9027`), and improvements to some completions. - New completions for ``qdbus`` (:issue:`9031:`) and ``reflector`` (:issue:`9027`), and improvements to some completions.
- ``history merge`` when in private mode is now an error, rather than wiping out other sessions' history (:issue:`9050`). - ``history merge`` when in private mode is now an error, rather than wiping out other sessions' history (:issue:`9050`).
- The error message when launching a command that is built for the wrong architecture on macOS is more helpful (:issue:`9052`).
This release also fixes a number of problems identified in fish 3.5.0. This release also fixes a number of problems identified in fish 3.5.0.

View File

@ -543,6 +543,14 @@ void safe_report_exec_error(int err, const char *actual_cmd, const char *const *
actual_cmd); actual_cmd);
break; break;
} }
#ifdef EBADARCH
case EBADARCH: {
FLOGF_SAFE(exec,
"Failed to execute process '%s': Bad CPU type in executable.",
actual_cmd);
break;
}
#endif
default: { default: {
char errnum_buff[64]; char errnum_buff[64];
format_long_safe(errnum_buff, err); format_long_safe(errnum_buff, err);