This repository has been archived by the owner on May 4, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 653
Calling uv_read_stop on stdin tty causes EOF to never be read #982
Comments
Hm it appears that I haven't investigated this enough. I seem to have prematurely opened this (I think the code is right). Closing for now until I figure out what's going on. Sorry for the noise! |
Investigated a bit more, updated the program, and it looks like this may actually be a bug. |
Confirmed, thanks. Possibly related to #971. |
bnoordhuis
added a commit
that referenced
this issue
Nov 8, 2013
Work around an epoll quirk where it sometimes reports just the EPOLLERR or EPOLLHUP event. In order to force the event loop to move forward, we merge in the read/write events that the watcher is interested in; uv__read() and uv__write() will then deal with the error or hangup in the usual fashion. Fixes #982. This is a back-port of commit 24bfef2 from the master branch.
Thanks for looking into this! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When I compile that program, and then run it via
echo a | ./foo
, the program will never exit (it never sees EOF for stdin). If the call touv_read_stop
is omitted, however, then the program will successfully exit.I also found out that running
./foo
and then hitting ctrl+D does indeed see the EOF (and the program exits). This program was initially tested on linux (where it didn't work), but it turns out that on osx this does work (bothecho a | ./foo
and./foo
+ ctrl-d).I also found out that the reading one byte at a time is important, If I read a larger buffer then this works as expected (at least in the small cases).
The text was updated successfully, but these errors were encountered: