You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 4, 2018. It is now read-only.
The basic logic is as follows, error handling elided for brevity:
for (fd=0; fd <= 2; fd++) {
if (isatty(fd))
dup2(open("/dev/tty", O_RDWR), fd);
}
That lets libuv / node switch its tty to non-blocking mode without affecting other programs that expect it to be in blocking mode. That would, for example, fix the following issue:
$ node | cat
> process
[lots of data]
events.js:68
throw arguments[1]; // Unhandled 'error' event
^
Error: write EPIPE
at errnoException (net.js:787:11)
at Object.afterWrite (net.js:598:19)
at process._makeCallback (node.js:248:20)
The basic logic is as follows, error handling elided for brevity:
That lets libuv / node switch its tty to non-blocking mode without affecting other programs that expect it to be in blocking mode. That would, for example, fix the following issue:
See nodejs/node-v0.x-archive#3027 and this comment in particular.
It remains to be investigated if this approach works on all supported platforms.
The text was updated successfully, but these errors were encountered: