diff options
Diffstat (limited to 'pjlib/src/pj/file_io_win32.c')
-rw-r--r-- | pjlib/src/pj/file_io_win32.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/pjlib/src/pj/file_io_win32.c b/pjlib/src/pj/file_io_win32.c index 2497be68..27848497 100644 --- a/pjlib/src/pj/file_io_win32.c +++ b/pjlib/src/pj/file_io_win32.c @@ -204,3 +204,17 @@ PJ_DEF(pj_status_t) pj_file_getpos( pj_oshandle_t fd, return PJ_SUCCESS; } +PJ_DEF(pj_status_t) pj_file_flush(pj_oshandle_t fd) +{ + BOOL rc; + + rc = FlushFileBuffers(fd); + + if (!rc) { + DWORD dwStatus = GetLastError(); + if (dwStatus != 0) + return PJ_RETURN_OS_ERROR(dwStatus); + } + + return PJ_SUCCESS; +} |