Open alexcrichton opened 10 years ago
It's not a libuv bug but maybe libuv could report the error a little nicer.
What happens is that epoll_ctl() returns EPERM when libuv tries to add the file descriptor and it's not equipped to deal with that.
Standard operating procedure is to check the file type with uv_guess_handle() first, then branch accordingly.
Ah ok, the logic I was using was "fall back to using fs operations only if tty creation fails". Thanks for the clarification!
On linux, if this program is compiled and run like
./foo < any_file
at the command line, it will cause an abort in uv's event loop. This works fine if you runecho foo | /foo
or have stdin attached to a terminal.I'm not sure if you're supposed to be able to even do this? I get the same abort if a
uv_pipe_t
is used to read stdin, but it works to calluv_fs_read
on stdin in this case.