main: Fixup non-blocking reads

Sometimes, we can get the notification of a read that ends up returning
EAGAIN or EWOULDBLOCK. We need to handle this as a non-error case as
this is normal for non-blocking file descriptors.

We can also optimize the routine by using edge triggering and reading
out all available post codes until we get an EAGAIN.

Change-Id: I16585cf70620ae8cd54ef284a0fe357401957f42
Signed-off-by: William A. Kennington III <wak@google.com>
1 file changed