Refactor
Don't die if we get EAGAIN or EINTR