Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/store/journal.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,11 @@ ray_err_t ray_journal_write_bytes(const ray_ipc_header_t* hdr,
#ifndef RAY_OS_WINDOWS
if (fsync(fileno(g_journal.fp)) != 0) return RAY_ERR_IO;
#else
FlushFileBuffers((HANDLE)_get_osfhandle(_fileno(g_journal.fp)));
/* FlushFileBuffers returns 0 (FALSE) on failure — surface it as an I/O
* error like the fsync path above, so SYNC mode's durability guarantee
* isn't silently dropped on Windows. */
if (!FlushFileBuffers((HANDLE)_get_osfhandle(_fileno(g_journal.fp))))
return RAY_ERR_IO;
#endif
}
return RAY_OK;
Expand Down
Loading