mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-22 12:41:08 +08:00
reader: Skip FreeBSD directory hack for stdin
This can be triggered on linux with: ```js import { spawn } from 'child_process'; const shell = spawn('/home/alfa/dev/fish-shell/build-c++/fish', []); ``` Under node 19.8.1. *No clue* how that happens, but since this is a workaround we shall skip it.
This commit is contained in:
parent
e2579a59ba
commit
aa268696bf
|
@ -4690,7 +4690,9 @@ static int read_ni(parser_t &parser, int fd, const io_chain_t &io) {
|
|||
}
|
||||
|
||||
/* FreeBSD allows read() on directories. Error explicitly in that case. */
|
||||
if (buf.st_mode & S_IFDIR) {
|
||||
// XXX: This can be triggered spuriously, so we'll not do that for stdin.
|
||||
// This can be seen e.g. with node's "spawn" api.
|
||||
if (fd != STDIN_FILENO && buf.st_mode & S_IFDIR) {
|
||||
FLOGF(error, _(L"Unable to read input file: %s"), strerror(EISDIR));
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user