Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read stdin input from the dup()’ed non-blocking handle #1064

Merged
merged 1 commit into from
Jul 14, 2016

Conversation

addaleax
Copy link
Contributor

Read stdin from the handle opened via fopen('php://stdin'), not the original STDIN handle which may not have been affected by the stream_set_blocking() call.

I’d look for confirmation from others but I’m pretty sure this fixes #993.

Read stdin from the handle opened via `fopen('php://stdin')`, not
the original `STDIN` handle which may not have been affected
by the `stream_set_blocking()` call.

Fixes: squizlabs#993
@gsherwood
Copy link
Member

I've put out a call for testers on the linked issue because I can't replicate any of the problems myself. Still, it looks like an obvious correction to the code, but I'm just not sure if I can call issue #993 fixed with it or not.

@addaleax
Copy link
Contributor Author

That’s perfectly understandable; if you know your way around Node.js a bit, you might be able to use the test case provided in nodejs/node#7652 to reproduce it (I think it’s because Node.js spawns child processes with socketpair()s instead of pipe()s which then behave differently when dup()ing them… but that’s just a guess).

@masterzen
Copy link

Unfortunately that's something I already tested and this doesn't fix the issue for me.

@gsherwood
Copy link
Member

So it sounds like this fix doesn't fix the other bug report, but it obviously fixes your problem and it's an obvious correction, so thanks for the PR.

@gsherwood gsherwood merged commit 4300dc9 into squizlabs:master Jul 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

phpcs reads from stdin which requires a terminal, and hangs if there are none.
3 participants