while (close(soc) < 0) { if (errno == EINTR) continue; perror("close"); exit 1; }