Adding extremely simple poll() call.
Adding check for poll() return value.
Adding loop for poll().