check for EINTR to avoid spinning in an empty file
Merge pull request #1720 from McAtte/add-check-for-EINTR

check for EINTR to avoid spinning in an empty file