| 206 | } |
| 207 | |
| 208 | static int asyncSync(sqlite3_file* pFile, int flags) { |
| 209 | VFSAsyncFile* p = (VFSAsyncFile*)pFile; |
| 210 | try { |
| 211 | waitFor(p->file->sync()); |
| 212 | return SQLITE_OK; |
| 213 | } catch (Error& e) { |
| 214 | if (e.isInjectedFault()) { |
| 215 | VFSAsyncFile::setInjectedError(SQLITE_IOERR_FSYNC); |
| 216 | } |
| 217 | |
| 218 | TraceEvent("VFSAsyncFileSyncError") |
| 219 | .error(e) |
| 220 | .detail("Filename", p->filename) |
| 221 | .detail("Sqlite3File", (int64_t)pFile) |
| 222 | .detail("IAsyncFile", (int64_t)p->file.getPtr()); |
| 223 | |
| 224 | return SQLITE_IOERR_FSYNC; |
| 225 | } |
| 226 | } |
| 227 | |
| 228 | /* |
| 229 | ** Write the size of the file in bytes to *pSize. |
nothing calls this directly
no test coverage detected