mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-07-02 00:51:15 -03: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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user