I've been going around and around trying to figure out why the lightpen code in pdp1.c hags when a display disconnects. Internally, a poll() for POLLIN status is done and if set a read is done. This is so it doesn't block on no lightpen data received.
What is happening is that poll() returns 1, which says there's an event.POLLIN is set in the response, no other event flags. This should mean data ready to read, right?
But, the read returns 0, nothing to read.
I didn't expect this, and kept looping because poll() kept saying there was data.
Ok, finally to the point, anyone know why this behavior is happening? It seems to contradict what the ooll documentation says. The file descriptor is a socket. I fixed the hang by explicitly checking that read actually returned something.
Bill