keithw/mosh — pull request #218 by saurik (2012-04-18 11:09:32+00:00)
Title: Use select(), as poll() on OS X 10.6.8 doesn't work.

On OS X 10.6.8, the host_fd file descriptor (which is the master side of the pseudo-terminal created to run the requested command) fails in poll(): you get back POLLNVAL, and the entire mosh stack just grinds to a halt.

Given that there are only three file descriptors, and given that they are just being compared with explicit if statements, there is no value in poll(): it just means the code is less portable. I've changed it to use select().