Fix poller to only check if stdin and node are readable.

Thanks to James Zeng for pointing this out!
This commit is contained in:
Bob Lantz
2012-05-10 16:32:55 -07:00
parent cfd381134f
commit cece39e439
+3 -2
View File
@@ -313,14 +313,15 @@ class CLI( Cmd ):
nodePoller = poll() nodePoller = poll()
nodePoller.register( node.stdout ) nodePoller.register( node.stdout )
bothPoller = poll() bothPoller = poll()
bothPoller.register( self.stdin ) bothPoller.register( self.stdin, POLLIN )
bothPoller.register( node.stdout ) bothPoller.register( node.stdout, POLLIN )
if self.isatty(): if self.isatty():
# Buffer by character, so that interactive # Buffer by character, so that interactive
# commands sort of work # commands sort of work
quietRun( 'stty -icanon min 1' ) quietRun( 'stty -icanon min 1' )
while True: while True:
try: try:
print 'waiting for input'
bothPoller.poll() bothPoller.poll()
# XXX BL: this doesn't quite do what we want. # XXX BL: this doesn't quite do what we want.
if False and self.inputFile: if False and self.inputFile: