| 105 | } |
| 106 | |
| 107 | void FileTraceLogWriter::lastError(int err) { |
| 108 | // Whenever we get a serious error writing a trace log, all flush barriers posted between the operation encountering |
| 109 | // the error and the occurrence of the error are unblocked, even though we haven't actually succeeded in flushing. |
| 110 | // Otherwise a permanent write error would make the program block forever. |
| 111 | if (err != 0 && err != EINTR) { |
| 112 | onError(); |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | void FileTraceLogWriter::write(const std::string& str) { |
| 117 | write(str.data(), str.size()); |