Put a loop around select() to take care of EINTR.