Helper function to keep trying to write until it succeeds or really errors out
| 53 | |
| 54 | // Helper function to keep trying to write until it succeeds or really errors out |
| 55 | static ssize_t |
| 56 | writeRetry(int fd, const void* src, size_t size) |
| 57 | { |
| 58 | ssize_t error; |
| 59 | int attempts = 0; |
| 60 | |
| 61 | do { |
| 62 | error = write(fd, src, size); |
| 63 | } while (error == -1 && (errno == EINTR || errno == EPIPE) && ++attempts < 5); |
| 64 | |
| 65 | return error; |
| 66 | } |
| 67 | #endif |
| 68 | |
| 69 | // ----------------------------------------------------------------------------------------------------------- |
no outgoing calls
no test coverage detected