| 36 | } |
| 37 | |
| 38 | int TokenPipeEnd::TokenWrite(uint8_t token) |
| 39 | { |
| 40 | while (true) { |
| 41 | ssize_t result = write(m_fd, &token, 1); |
| 42 | if (result < 0) { |
| 43 | // Failure. It's possible that the write was interrupted by a signal, |
| 44 | // in that case retry. |
| 45 | if (errno != EINTR) { |
| 46 | return TS_ERR; |
| 47 | } |
| 48 | } else if (result == 0) { |
| 49 | return TS_EOS; |
| 50 | } else { // ==1 |
| 51 | return 0; |
| 52 | } |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | int TokenPipeEnd::TokenRead() |
| 57 | { |
no outgoing calls
no test coverage detected