| 1792 | } |
| 1793 | |
| 1794 | static int sync_writer_output(FILE *fp) { |
| 1795 | if (fflush(fp) != 0) { |
| 1796 | return ERR_WRITE_FAILED; |
| 1797 | } |
| 1798 | #ifdef _WIN32 |
| 1799 | return _commit(_fileno(fp)) == 0 ? 0 : ERR_WRITE_FAILED; |
| 1800 | #else |
| 1801 | return fsync(fileno(fp)) == 0 ? 0 : ERR_WRITE_FAILED; |
| 1802 | #endif |
| 1803 | } |
| 1804 | |
| 1805 | static int discard_writer_output(write_db_ctx_t *w, int rc) { |
| 1806 | /* Cleanup runs after the failure that brought us here, and a library |
no outgoing calls
no test coverage detected